Knowledgebase:

Running multiple versions of Java on the same Windows machine

Posted by Travis Cox, Last modified by Peggie Wong on 06/24/2015 02:21 PM

Java is a very popular programming language and chances you have several applications that require Java. The problem is that different applications require different versions of Java. For example, you may have an older application that requires Java 5 where the Ignition client or designer requires Java 6 or higher. Of course you can use multiple versions of Java under Windows and different applications can use different Java versions. This article explains how to run multiple versions of Java side-by-side on the same Windows machine.

Order of Java Installations

First of all, the order in which you install the Java Runtime Environments is really important. You should install the JREs from oldest to newest in that order. If you install the JREs out of order, it is best to simply remove all Java installations, restart the machine, and install them from oldest to newest. This is giving the machine the best chance to recognize multiple Java versions.

Location of Java Installations

Each Java installation gets installed at:

C:\Program Files\Java\jreX

where X represents the version of Java. So if you have Java 5 and Java 8 installed you will have to directories. Make a note of the different versions you have installed.

Java Browser Plugin

If your application runs in a web browser using Java's browser plugin, you can only have one version at a time. Ignition does not use Java's browser plugin so you can continue using an older version.

Running Existing Java Application

It is easy to specify which Java version you want to use when running Ignition's client. So, it is important to tell Windows to use your older version of Java by default. That way your existing application continues to run. To do this we need to set the Windows PATH variable to the correct version of Java. To find out which version is on the path right now simply do the following:

  1. Open Command Prompt by pressing Start Key + R. Type cmd and press Enter.
  2. Type "java -version" and press Enter.
  3. You will see which version of Java is currently on the path. It will start with 1.X.X, so if it is 1.7.0_05 it is Java 7.

Java Version

You will find either that no Java version is on the path or you will know which version is currently on the path. If the version found is the version required by your existing application you can skip down to opening Ignition's client. If not, we need to change the Windows PATH variable to put the correct Java version. Follow these steps:

  1. Open the Environment Variables window. Open File Explorer (Start Key + E). Right click on "My Computer" and select "Properties". Click "Advanced system settings". Click on the "Environment Variables" button in the
    "Advanced" tab.

    Environment Variables

  2. Find the Path variable in System Variables and click "Edit...".

    Path

  3. Now you need to add the path to your Java version that your existing application uses. You need to make sure it points to the bin folder for your Java version. It should look something like:

    C:\Program Files\Java\jre1.6.0_01\bin

    Make sure to separate the path locations with a semi-colon (;).

    **NOTE** : The windows installer's for Java puts java.exe in your System32 folder so that you can run Java without setting environment variables. When adding "C:\Path\to\your\Java\version\bin" to your PATH make sure that it appears before C:\Windows\System32. Also make sure a different path to Java doesn't appear before your addition.

  4. Once you have added the correct version to the Windows PATH, type "java -version" in the Command Prompt to verify.

Running Ignition Client

Ignition will try to use the correct version of Java automatically using the native client launcher. You don't want to use Java Web Start since you may have to change a few settings to get it to work. To use the native client launcher simply follow the steps below:

  1. Open the Ignition Gateway home page in your web browser (http://IPADDRESS:8088)
  2. Download and run the Windows client launcher.

    Native Client Launcher
  3. Enter in your Ignition Gateway URL on the "Manually Input Gateway" tab and press Apply. Then press "Continue" at the bottom.

    Launcher URL
  4. Launch your project and it will find the correct version of Java for you.

That is it! It is very possible to run multiple versions of Java on the same machine so you can run your existing applications and Ignition at the same time. You just need to make sure a few house keeping items are taken care of. If you have any questions or are experiencing any issues please contact our tech support.

(62 vote(s))
Helpful
Not helpful