LWJGL Forum

Programming => General Java Game Development => Topic started by: Ciardhubh on February 25, 2009, 10:59:07

Title: Where to get JRE to bundle with games?
Post by: Ciardhubh on February 25, 2009, 10:59:07
I want to bundle a JRE with a game. How to do this is not an issue. My problem is, that as far as I can tell, I have to install every JRE I want to bundle, so I can get to the JRE files.

For example if I want to create stand-alone download versions of a game for Windows, Linux or Mac, I have to install each JRE on the respective system and then copy the required parts. Right? Apart from being cumbersome, I don't even have a Mac, so I cannot install it (it's only a test, so I can be a bit reckless and distribute an untested version for now).

Is there a website that has bundle-ready JREs for various systems, e.g. a ZIP archive I can conveniently distribute with my game? I only found installers on Sun's and Apple's websites.
Title: Re: Where to get JRE to bundle with games?
Post by: elias on February 25, 2009, 11:07:36
Macs already have java installed through system updates, and you can safely require a installed, working JRE from linux users. That leaves windows users, where I'd either bundle the full installer and run that (in silent mode) from your own installer. If you're worried about distribution size, bundle the smaller online installer that fetches the required parts from the web.

- elias
Title: Re: Where to get JRE to bundle with games?
Post by: Ciardhubh on February 25, 2009, 11:56:17
Quote from: elias on February 25, 2009, 11:07:36
Macs already have java installed through system updates,

Thanks. That's nice to know. Are they up to date, i.e. Java 6? Can I expect a certain minimum version? Or does it depend on what the user initially installed?

Quote from: elias on February 25, 2009, 11:07:36
and you can safely require a installed, working JRE from linux users.

The problem on Linux is that they can have any version installed, depending on distribution or personal preference; not to mention potential misconfigurations.

Quote from: elias on February 25, 2009, 11:07:36
That leaves windows users, where I'd either bundle the full installer and run that (in silent mode) from your own installer. If you're worried about distribution size, bundle the smaller online installer that fetches the required parts from the web.

I don't want a JRE installer as that would fail if the user is not logged in as an administrator. Installing something (as opposed to simply extracting a zip-archive) is an additional step that can put off potential users. Maybe the user already has an older version and does not want to upgrade. Or he's afraid of installing something. Or he just doesn't care enough to alter his system and so on.

I intend to bundle it with launch4j or another native wrapper. Basically I want to a self-contained application that acoids as many potential problems and is as convenient as possible (within reasonable bounds).
Title: Re: Where to get JRE to bundle with games?
Post by: mot on March 03, 2009, 10:51:23
You might be interested in something like this:

http://nsis.sourceforge.net/Java_Launcher_with_automatic_JRE_installation
Title: Re: Where to get JRE to bundle with games?
Post by: elias4444 on March 03, 2009, 17:20:01
I've looked into that one, but get nervous having to hard-code the java download URL into the script. The URL will change whenever a newer version of Java comes out.
Title: Re: Where to get JRE to bundle with games?
Post by: mot on March 03, 2009, 20:53:29
Well you could point it at your own server and keep a redirect to the latest version there...
Title: Re: Where to get JRE to bundle with games?
Post by: elias4444 on March 03, 2009, 23:34:54
Ah! What a great idea! Thanks. ;)