How to bundle a JRE

What’s the best way to do this? ???

I could just pass control to a copy of the sun installer, but the user would get all the dialog options. Maybe there’s a silent install option. Even so, how do I make this JRE private and not muck up the users current configuration? Could I just zip my existing JRE up myself instead? Would I need to create any keys in the windows registry?

Alan :slight_smile:

Yes, it’s as simple as that.

  1. copy and paste the JRE-dir into your game-dir
  2. make the launcher (batch file?) use the java executable of the private JRE
  3. zip the gamedir
  4. distribute the zip

Riven,

Thanks, I couldn’t believe it would be that easy ;D

Alan

Riven, I am thinking about same problem here. It seems unpractical to me, though, to include jre (cca 60 MB) with my game that is 10 MB “heavy”. What do you think, is there better solution? And I don’t think that one is permitted to cut the size of jre…

Zipped JRE is “only” 15-16MB

If you don’t want to break the JRE distribution-license, you’re pretty much stuck here.
note the if

Aren’t you glad the Google/Sun deal now also includes GoogleToolbar in the JRE? ::slight_smile:

[quote=""]
Yes, :P, “only” 15 MB. Tnx for info on toolbar, I am going to check what’s that new agreement…

I want to do this too, but I have run into a problem. I installed the latest JRE in my game’s directory. Shortly afterwards, it pops up the “Java updater” dialog. This could be a bit confusing for the non-technical user. But what is seriously wrong, is that if you click on “install”, it does not install the updated JRE over old one. It installs a new version of the JRE in the default C:/JRE… folder. Then the next time Java Updater runs, my bundled version has not been updated, so it asks to install a new JRE again. With the same result. Anyone else come across this? Seems like the Updater should update the location it is running from.

I’m thinking that this is because I actually installed the JRE in my game directory. If I just copy and paste the JRE folder into the game directory as Riven suggests, does this stop the Java Updater from kicking in?

Don’t ship an installable JRE, just copy all files in the JRE directory and zip em.