I need to ship a Java product with JRE included with it but I don't want the user to tackle the installation choices. My requirements are:

  1. JRE installation in a sub-folder of my application so that I can use relative paths in my .bat and .sh files.
  2. Installation should not mess with existing JREs on the system.
  3. Installation process should be as simple as possible.

Question: Can I simply unzip a JRE folder on to the client's machine without running the installer? If, no, what else can I do to keep the process as painless as possible?

  • Every time someone installs an application with a separate, nested JRE bundle, James Gosling weeps. Write once, run anywhere indeed.
    – jscott
    Apr 25 '11 at 14:07
  • WORA didn't promise JRE (version) independence, it promised platform independence. Otherwise Java would have to freeze at 1.0 Apr 25 '11 at 14:31

I think if you are going to distribute it, you would want to make sure that you don't require an installer to be run otherwise you could overwrite defaults on the target workstation/ server. Then that client could get pretty upset!

If you include all the configuration files required to run your app with this self-contained jvm, you would be doing the same type of thing that other vendors do. So, I don't see this as a big issue. for example, don't require the enduser to set a JAVA_HOME systemwide and include any runtime options in a conf file like jboss does with run.conf or tomcat does with setenv.sh.

That being said, if you distribute the jvm, you're probably going to be responsible for supporting it, possibly well beyond the support periods that oracle provides--so you might want to consider that as a reason not to do it.


I see there are two options:

  1. Silent install It takes INSTALLDIR=<drive>:\<install_path> parameter
  2. Simply zip up an installed folder (see a discussion here)

I think for my purpose approach 2 is better because of it's simplicity. One would have been better if we had to show the Java configuration tool in windows Control Panel or use the browser integration for applets/jnlp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.