Java4k Launcher (v1.1)

Download the current version (v1.1) (2.0 mb) which includes a Windows executable that detects the current win32 JRE. If you only have the 64-bit JRE installed, you’ll need to run the bat file. It also includes shell scripts for Linux and (fingers crossed) Mac.

Download the current version (v1.1) for Windows with a bundled 32-bit JRE (36.4 mb)

Source code and project is hosted here:

https://pikacode.com/groboclown/java4k-launcher/

You can open tickets on that site, or post bugs on this thread:

https://pikacode.com/groboclown/java4k-launcher/tickets/

Pretty cool.

We could maybe even allow people to download a java4k installer to run on their machine. I think that could be get these games distributed widely! I can provide whatever json services you wish.

appel, could you fix the JNLP file for 3DTunnel (gid 60)? It has an unescaped ampersand in the description, so the launcher throws a parse error when it tries to handle it.

Edit: as a workaround, for other people with the same problem, edit the downloaded file in work/bundle/downloads. I found it with grep, but it’s probably possible to find it with the index.json if you don’t have grep.

Edit 2: wow, it takes quite a lot of workarounds!

ampersand in gid 60 fixed.

just writing this text because riven forbids me posting anything that is uninterestingly short :slight_smile:

I was able to get the WebStart games to sort of work. However, it seems that many of the JNLP files redirect to other sites, and many of those are no longer available. There could be some hacks to redirect those using the caching mechanisms, but would it instead be possible to host those files directly on the java4k site?

I know that this is lower priority, because we want people playing the new games for this year’s contest, but I would like to be able to look at some of those old games for historical preservation purposes.

I think this would be a legal problem, when they where never uploaded to Java4k but hosted elsewhere you would have to get the approval from each author to move/host them on another server.

Appel, how are the JNLP files stored? There are a few others with unescaped ampersands, but there are also a considerable number which don’t parse because of encoding errors. They claim to be UTF-8, but aren’t.

Contests from 2005,2006,2007 were migrated over from javaunlimited when woogley was hosting the contest. So, all should be there and working.

During 2008,2009 the developers hosted their own webstarts. Since then a lot of these webstart games have disappeared, an obvious consequence of time.
However, and fortunately, ctomni231 managed to archive most of them and send it to me, so I have majority of those webstarts in a zip file. I’ve yet to add it to the site though.

All applets starting from 2010 are working.

Is java so narcissistic about text encoding that it’s not possible to read the xml’s?

I made a JSON service in order to browse the catalog, with this as starting point: http://java4k.com/contests.php
I recommend some json extension in your browser to see it structured and so you can browse it.

A new version of the launcher is available that’s compatible with the updated java4k.com data. If you have an existing version, you’ll need to wipe out the cache directory.

Yes. E.g.

Downloading file ./downloads/28b from http://java4k.com/index.php?action=games&method=play&gid=141
Exception in thread "main" com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 4-byte UTF-8 sequence.
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
    at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:473)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1719)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1393)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2769)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
    at net.javagaming.java4k.launcher.webstart.JnlpDescription.loadXml(JnlpDescription.java:253)
    at net.javagaming.java4k.launcher.webstart.JnlpDescription.load(JnlpDescription.java:83)
    at net.javagaming.java4k.launcher.java4kcom.Java4kGameDescription.loadJnlpSettings(Java4kGameDescription.java:115)
    at net.javagaming.java4k.launcher.java4kcom.Java4kGameDescription.load(Java4kGameDescription.java:88)
    at net.javagaming.java4k.launcher.cache.CachePopulator.main(CachePopulator.java:61)

I’ll see how the new launcher handles things.

I converted the ANSI encoded files to UTF-8.

The launcher is a tad slow at loading stuff. Any reason for that? :-\

Those of you who have actually managed to run this: how did you handle the problem with http://voidstar.brinkster.net/mazegame4k/ not being a JNLP file? I’m not sure what to change to allow load-cache to finish.

The file under resources/net/javagaming/java4k/launcher/fixed-urls.json was made with this purpose in mind. You’ll need to add an entry in that file to note the changed URL. In this case, I recommend creating a local jnlp file that’s essentially a no-op replacement.

One of the tasks I have is to make the cache loading tool skip bad files like this, so soon it shouldn’t be an issue. The current code can keep going now.

I’m having a problem downloading it.

The size shown in the page is 4.9 MB but chrome says it’s 7.4 MB! I’ve downloaded it though and when I try to extract, it says (Error 21 - Is a Directory)

The tar.gz version works.
You can extract it with 7zip etc.

I posted a new version, and the bundled zip download should be working now.

Can’t somebody make a launcher in 4k? :point:

Cas :slight_smile:

someone already did:

Check out mine :wink:

http://rtsmaker.com/J4K/J4KLauncher.jar

ist still buggy though (some games make it hang itself), but in principle it can be done.