Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Java4k Launcher (v1.1)  (Read 10334 times)
0 Members and 1 Guest are viewing this topic.
Offline Groboclown
« Posted 2013-12-02 17:30:50 »

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/


Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #1 - Posted 2013-12-02 22:29:23 »

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.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline pjt33
« Reply #2 - Posted 2013-12-02 23:43:54 »

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!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #3 - Posted 2013-12-03 00:23:13 »

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 Smiley

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Groboclown
« Reply #4 - Posted 2013-12-03 09:11:21 »

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.

Offline Damocles
« Reply #5 - Posted 2013-12-03 11:01:47 »

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.

Offline pjt33
« Reply #6 - Posted 2013-12-03 12:08:26 »

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.
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #7 - Posted 2013-12-03 20:08:52 »

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.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Groboclown
« Reply #8 - Posted 2013-12-03 21:14:54 »

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.

Offline pjt33
« Reply #9 - Posted 2013-12-03 22:18:12 »

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

Yes. E.g.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #10 - Posted 2013-12-04 00:47:53 »

I converted the ANSI encoded files to UTF-8.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #11 - Posted 2013-12-06 00:13:22 »

The launcher is a tad slow at loading stuff. Any reason for that?  Undecided

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline pjt33
« Reply #12 - Posted 2013-12-06 00:32:10 »

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.
Offline Groboclown
« Reply #13 - Posted 2013-12-06 04:28:49 »

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.

Offline SHC
« Reply #14 - Posted 2013-12-06 04:54:02 »

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)

Offline Damocles
« Reply #15 - Posted 2013-12-06 08:04:29 »

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

Offline Groboclown
« Reply #16 - Posted 2013-12-06 08:09:43 »

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

Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #17 - Posted 2013-12-06 09:33:10 »

Can't somebody make a launcher in 4k?  Pointing

Cas Smiley

Offline Phased
« Reply #18 - Posted 2013-12-06 09:34:09 »

someone already did:

http://www.java-gaming.org/topics/launcher4k-micro-version/31411/view.html
Offline Damocles
« Reply #19 - Posted 2013-12-06 10:13:50 »

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.

Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #20 - Posted 2013-12-06 11:35:55 »

Heh, brilliant Smiley

Cas Smiley

Offline pjt33
« Reply #21 - Posted 2013-12-07 11:23:20 »

The current code can keep going now.
Yep, I managed to get load-cache to run to completion. I also managed to fix bin/java4k and get it to run:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
#!/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.
Offline Groboclown
« Reply #22 - Posted 2013-12-07 15:10:12 »

I also managed to fix bin/java4k and get it to run:
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.

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.
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.

Offline Groboclown
« Reply #23 - Posted 2013-12-08 04:17:03 »

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.

Offline Groboclown
« Reply #24 - Posted 2013-12-11 03:10:56 »

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.

Offline Groboclown
« Reply #25 - Posted 2013-12-11 15:31:20 »

RC1 is available.
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.

Offline Groboclown
« Reply #26 - Posted 2013-12-12 01:02:24 »

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.

Offline ra4king

JGO Kernel


Medals: 347
Projects: 3
Exp: 5 years


I'm the King!


« Reply #27 - Posted 2014-01-11 23:43:53 »

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 Smiley

Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #28 - Posted 2014-01-12 02:14:14 »

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)
Offline SHC
« Reply #29 - Posted 2014-01-12 02:54:33 »

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.

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

Pages: [1] 2
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (44 views)
2014-09-23 14:38:19

radar3301 (25 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (39 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!