Whatever Launch.html runs. If that runs an applet, what are the alternatives ?
This is launch.html
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Test page for launching the application via JNLP</title>
> </head>
> <body>
> <h3>Test page for launching the application via JNLP</h3>
> <script src="http://java.com/js/deployJava.js"></script>
> <script>
> deployJava.createWebStartLaunchButton("launch.jnlp")
> </script>
> <!-- Or use the following link element to launch with the application -->
> <!--
> <a href="launch.jnlp">Launch the application</a>
> -->
> </body>
> </html>
Ah, JNLP… As far as I remember I’m using it on my first game. It downloads and launch an jar file so user does not need to do anything manually. But it still needs the code to be signed. No, it is not the applet.
The alternative is to pack your game together with all necessary files, including JRE files, to a self extracting archive/installer. This have a great advantages - end user does not need to have java installed and you don’t need to sign the code.
Thanks. The self extracting archive sounds the way to go.
Do you have any tips on the best way to do this ?
Does [GameName]-Windows.zip have all the necessary files to run without a client Java installed ? If so then the only thing to do is turn that zip file into an exe file to self extract. How to do this ?
Use Launch4j or Janel to wrap jar or just launch it using exe file.
JVM is just another exec, it needs to be attached to your files, just add the whole jre folder into your installation/archive and provide a correct path to that jre in Launch4j/Janel. Both of them have an option to use bundled JRE, so this is an easy task. If you are beginner then try with Launch4j first, all you need is to run it and fill the necessary fields.
I tried Launch4J and although it created the exe file, when I ran the program from that exe the screen stayed black (although it did show a splash screen).
What am I missing (apart from brains) ?
If I run this program from the JMonkey IDE but right clicking on the Main file and selecting Run File the program works properly.
If I Clean and Build then extract the Windows.zip file from the dist folder to another program then run the exe file within that, it runs, but when I ebter the game loop the screen stays black. I can’t work out why.
Make a simple test project of just the blue cube and see if it works. (Probably will.) Then start adding stuff like your game and see what finally breaks.
One common case for new users is doing something strange with assets. Don’t know if that is what’s going on here as I can’t see your project setup.