Publishing a game -> Include a JRE into the package ?

I don’t know if thats common but here is the thing:

If I create a Java game I dont want the user to have any trouble whatsoever with Java. In fact he shouldn’t even notice its Java
So what I would do is include a whole JRE folder into the package and the batch or Exe preferable (through JStart) would launch java.exe from that JRE and run my game

So it wouldn’t even matter if the user has JRE installed. However of course since a JRE is only for one OS… yeah

but I will take a look at JSmooth

any other suggestions ?

I use NSIS to build an installer (with LZMA compression). You can add shortcuts to the desktop, the start menu, provide an uninstaller, etc etc.

A private JRE is the only way to ensure everything works, unfortunately.

While you’re at it, you’ll be doing yourself a huge favour if you embed some system that can update itself (the jars on the classpath) right before you call the main-method. Using URLConnection to check the If-Modified-Since will do the trick pretty easily.

Ya I tried it yesterday, because I tried installshield before and … nah
But I gotta learn those NSIS scripts…

I actually did this lately =)

I also check if the host is windows or not and enable D3D if he is.

if (System.getProperty( "os.name" ).startsWith("Windows"))
   	 	{
   	 		System.setProperty("sun.java2d.ddforcevram", "true");
   	 		System.setProperty("sun.java2d.d3d", "true");
   	 	}
   	 	else // Linux, Mac ...
   	 	{
   	 		System.setProperty("sun.java2d.opengl", "True");
   	 	}

kinda nice I think, as I work with Java2D

I’m way too lazy for that. Google a bit for script-generators.

We’ve taken the route of bundling the JRE with the application at work, for a Swing application. A few people complained that the download was a bit big, but the large majority had no problems with it. Also, we have had almost no complaints about the application not launching, and I’m very sure that we would have enormous problems with this if we didn’t bundle the JRE.

So, if you’re serious about your game and want it to be played by as many people as possible, definitely take that route. You can use Launch4j (free) or Exe4j (commercial). Obviously this will only work on Windows, but the large majority will have that anyway and Linux users will know what to do anyway. And all Macs have Java 5 out of the box.