How do companies handle the need for different Java requirements on the same user?

Solution 1:

Agree with the comments that Java can run as a standalone executable. You can have as many versions as you like on the same machine.

You may have issues if multiple applications use the JAVA_HOME environment variable, and they each require a different version. As noted in comments, this is easily avoided by using shell scripts to launch each application, taking care to set PATH and JAVA_HOME correctly.

(Personally, I will not put JAVA_HOME in my system environment; I will define it in each shell script that launches an application; since no program can use the system default, this avoids any program using the wrong version accidentally. This is a personal preference -- not suitable for all environments.)


Web applications are much more interesting, since web applications typically require a system installed JRE. It is very tragic, but at present, you cannot run different web applications/applets with different system JREs at the same time.

Java expects you to use the latest version. If you require a specific version, you must have only that specific version selected in Java Runtime Environment Settings:

Control Panel | Java | Java tab | View button

Select the specific JRE you need. You must un-select all others.

To switch versions later, you must come back to the control panel and do it again.

This is very unfriendly to customers who have to run multiple web applications that require different versions. These applications cannot be run on the same computer at the same time.


More information is available from this question:

Java running in specific environment?