1

I have to install a lower version of Java on some clients but some of them have a new version already installed. Do you know which one will take precedence? Is there a way to force Java to use a certain version without uninstalling the other? We have an application that requires the certain lower version.

Makoto
  • 104,088
  • 27
  • 192
  • 230
user1342164
  • 1,434
  • 13
  • 44
  • 83

3 Answers3

6

By client I suppose you mean some Windows machine?

You can control which version is used by setting:

  1. The system path to include the java.exe you want used at runtime.
  2. The JAVA_HOME variable to point to the JDK library, only if development takes place on the machine.
amahfouz
  • 2,328
  • 2
  • 16
  • 21
2

If the client you are using does NOT have the option to setup JDK, then it will look into what ever JAVA_HOME you have defined in your OS environment variable.

There are clients, such as Eclipse, where you can define any version of JDK installed on your machine.

Armaiti
  • 766
  • 3
  • 11
1

Also, if you are just launching your app using Java (and the app itself is not invoking any Java), you may be able to get away with just setting the shortcut that launches the app:

...\my\path\to\java\java.exe NameOfAppMainClassInYourJar.class

and setting the classpath as indicated here.

amahfouz
  • 2,328
  • 2
  • 16
  • 21