Java4k Launcher (v1.1)

Heh, brilliant :slight_smile:

Cas :slight_smile:

Yep, I managed to get load-cache to run to completion. I also managed to fix bin/java4k and get it to run:

#!/bin/sh

if [ -d "$JAVA_HOME" ]; then
    JAVAEXE="$JAVA_HOME/bin/java"
else
    JAVAEXE="java"
fi

cd `dirname "$0"`/../work/bundle
"$JAVAEXE" -Dlauncher.dir="$PWD" -jar java4klauncher.jar $* || exit 1

saved with Unix line endings, not Windows ones.

Does the program actually use the cache? It seems to reload everything on-demand, even though I’ve primed the cache. (Since it just took 5 minutes to launch Snakes on a Plane, allowing me to fill the cache overnight would make it a lot more usable).

I’m going to open a ticket or two on Pikacode when my registration confirmation comes through.

The bundle ant task should automatically fix the line endings for both java4k and java4k.bat. That way, you can edit the file in your own line ending OS, and the distribution will be in the correct one.

Yes, it does use the cache, but I have been working through the security manager settings - apparently it was too restrictive, and the code was silently not allowing URLs to be created for local files. When I open up the permissions for the shipped jar, the thing runs much faster.

New version, with performance improvements, better webstart compatibility, and better messages.

The next big feature I’m planning on adding is showing and submitting comments.

RC1 is available. Please send me your bugs or improvement requests soon, so we can get this published out on the site.

It’s only available as a jar + startup scripts, so no EXE bundle available. If you have suggestions on how to bundle this with a JRE, or want to volunteer to do this yourself, please feel free to pitch in.

Apo found a bug with Class.getResource() not finding the file in the jar. RC2 fixed this.

EDIT: but there were still permission issues around loading the resource and temp file writing by ImageIO. RC3 fixes that.

RC4 - improved the applet experience by centering the applet frame when it appears, and gave it focus so keyboard applets don’t require the initial click.

Edit:

Added a version of the launcher that includes a windows executable (created using launch4j), and a version that has that executable + a bundled JRE 1.7 for Windows.

A Windows-based installer could be made to go with these. I’ll look into NSIS later.

If someone wants to volunteer to make a Mac bundle, please stand up. Or, I guess I coulld invest some time looking into this article (http://www.intransitione.com/blog/take-java-to-app-store/), but I don’t have any way to test it.

Java4K.exe doesn’t work and neither does the JAR. Running the BAT file works.
The error with the JAR is a NullPointerException in File’s constructor when you call it at line 80 of your Security class.

Also you should add judge comments :slight_smile:

java4k works for me, however the following 2014 games do not seem to work via the launcher:

-Supway4k
-In the dark 4k

(win7 64bit, using bundled jre)

I could make that for you. I’m having holidays till this friday.

I’ve tested the 2 versions of the launcher on my Win7 64bit with JRE7 and the results are the same :

  • Supway4k produce this

  • In The Dark 4K works for me :wink:

One suggestion, can you reactivate the “Play Game!” button when the window’s game is closed ?.

EDIT: No problem with other 2014 games

I’ll check out those issues soon and post an update when I have a fix.

That would be greatly appreciated!

I’ll check with Appel to see if he could add those to the Json output.

I get the same error as Gef when attempting to play Supway4k.

However I am still unable to play In The Dark 4k… a game window is displayed that is completely blank (black) and no mouse click/keyboard events cause any change…

The Supway issue was due to a parsing problem with the applet size. Launching the tool from the jar directly isn’t supported, so I added better error reporting. I’m still looking into the exe issue.

The issue around The Dark is actually due to a threading issue (I wouldn’t have been able to find it without the posted source - thanks Gef!). This is the same issue that some applets encountered when running on a Mac - the applet container wasn’t ready when the graphics context was requested. Some applets will loop at the start, waiting for the isAvailable() call to return true.

I don’t know the right fix for this one. Should the launcher be made to match of one specific JVM behavior (Windows) or another?

well I would say yes, target the behaviour of the most common jvm as that should mean most entries should be playable.

This has been the source of much controversy in the past, specifically in the 2009 competition when an update released near the end of the submission period introduced a bug in the applet lifecycle. Unfortunately I can never find the detailed analysis that I wrote up back then.

I added the fixes to the security classes, image size parsing, and some other little nuggets that were hiding around. Still no judges comments :frowning:

The direct-from jar launching should report a better error now. As for the Java4k.exe - if run the “no bundled jre” version, it expects a 32-bit version of the JRE to be installed. If you only have the 64-bit version, I’m guessing it won’t run. Which version did you try out?

My Chrome browser just updated to the latest JRE. Now, I get this error whenever I attempt to launch a 4K applet:

I’m sure I can tune the security settings, but I guess this is how most people will see the site from Chrome now.

Edit:

Through the Control Panel, I was able to turn off the check. Now, I get this:

Ugh.

I get the same result in Firefox after the recent update. That message after you turned it off is what I already got in FF before the update.

Welcome to the future !