?Queries?
We have a couple of applications running on Java 8 and would like now to bring in an application based on Java 6. Can both java versions work together in Windows platform?Is there any control panel to set the appropriate Java version for different applications, or any other way to set up, what version of Java will be used to run that particular application?
Solution
Of course we can use multiple versions of Java in Windows platform and different applications can use different Java versions. How is your application started? Usually you will have a batch file where there is something likeJava....
%JAVA6HOME%\bin\java ...
It is absolutely possible to install side-by-side several JRE/JDK versions. Moreover, you don't have to do anything special for that to happen, as Sun is creating a different folder for each (under Program Files).
There is no control panel to check which JRE works for each application. Basically, the JRE that will work would be the first in your PATH environment variable. You can change that, or the JAVA_HOME variable, or create specific cmd/bat files to launch the applications you desire, each with a different JRE in path.
It should be possible changing setting the JAVA_HOME environment variable differently for specific applications.
When starting from the command line or from a batch script you can use
set JAVA_HOME=C:\...\j2dskXXX to change the JAVA_HOME environment.
It is possible that you also need to change the PATH environment variable to use the correct java binary. To do this you can use
It is possible that you also need to change the PATH environment variable to use the correct java binary. To do this you can use
set PATH=%JAVA_HOME%\bin;%PATH%.
- install different versions of JDK you want to use
- create a link to that folder either by junction or by built-in mklink command
- set the PATH to the link
- If other version of java is to be used, delete the link, create a new one, PATH/JAVA_HOME/hardcoded scripts remain untouched
Also, use a simple script when starting jmeter with our own java version
setlocal
setlocal
set JAVA_HOME="c:\java8"
set PATH=%JAVA_HOME%\bin;%PATH%;
java -version
Using Java Web Start, you can install multiple JRE, then call what you need. On win, you can make a .bat file:
- Online Version:
- Launch from cache:
No comments:
Post a Comment