tags:

views:

178

answers:

2

Hi, I have created an exe with a launch4j Ant script and build.xml file. I want to bundle the JRE in my application and have to distribute it to clients. How do I do this?

Thanks, Rajani

+3  A: 

Well, just bundle everything under $JAVA_HOME/jre into your distribution (presumably a Zip/TAR file) and then have your scripts reference that (i.e. use the java executable under $JRE_HOME/bin to run your java program).

Remember that if you do this, you will have to deliver different distributions for different target platforms (Windows,OSX, linux etc) and architectures (or one bloated uber-distribution of course, but no one will thank you for that!).

oxbow_lakes
+2  A: 

This works great... if you want your program to run on just a single version of a specific OS.

Generally, though, bundling a JRE is a bad idea. Even on Windows, there are three versions of the JRE: one for x86, one for x86-64, and one for Itanium. Even if Sun does make it hard to find the 64-bit versions, they still exist.

The 64-bit versions of Java for Windows are actually on java.sun.com, but not java.com.

R. Bemrose