5

In our company, we use GPOs to push software updates such as Java updates. We have about 150 users in different offices located in different countries, all using Windows 7. We have a few office-specific applications, and no user has admin rights.

Lately, in some of our offices, there have been occasions when users would require different versions of Java; one application they use would be needing version A of Java, whereas another application would be needing version B. The worst scenario is when different Java versions are needed by the same user, depending on the application (web application or standalone application) being used.

We have had this problem for a couple of users in two offices this month and last month. Until now, we installed the adequate Java version when needed. Obviously that was time consuming. For next month, we are considering having specific virtual machines or computers for older Java versions. But that is not the best of solutions either. What can other solutions be ?

How do companies handle the need for different (and incompatible) Java requirements on the same user ?

5
  • 2
    There is nothing preventing multiple java versions from being on the same machine. At worst you may have to create start-up batch files that sets whatever environment variables (adds the java\bin front of PATH, JAVA_HOME, etc) are needed to make it work.
    – Eddie Dunn
    Dec 10, 2015 at 16:23
  • Agreed. But I assume that only one java version can be the default version at a given time. If a user has an application that requires Java version A but does not work with Java version B, and an application that requires Java version B but does not work with Java A: is there a way to use several versions at the same time ? Edit: I re-read your comment; you mean toggling between environment variables using batch files ? Would that require admin rights, or would power user rights be enough ?
    – salcoin
    Dec 10, 2015 at 16:32
  • 2
    Yes you just need to make sure that whatever app is launched with the correct PATH, java environment variables, and/or application configuration that would make it work.
    – Eddie Dunn
    Dec 10, 2015 at 16:33
  • Thank you, we will look into that. However, my first though is that it will be easier when it comes to standalone applications. And more.. interesting when it comes to web-applications :)
    – salcoin
    Dec 10, 2015 at 16:53
  • 1
    Each app will have to be treated on a case-by-case basis and yes I am sure web apps would be more problematic, but not insurmountable. ;)
    – Eddie Dunn
    Dec 10, 2015 at 19:26

1 Answer 1

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?

1
  • We haven't had that kind of issue in a while now (which is good, as it was a nightmare), but thanks for the elaborate and helpful answer :)
    – salcoin
    Oct 15, 2019 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .