How to run multiple versions of Java.


  1. Posts : 1,436
    Windows 7 Home Premium
       #1

    How to run multiple versions of Java.


    Hiyo.

    I want to be able to run multiple versions of Java on my computer, I would like to set it so that one program uses the older version of Java but all other programs use the latest release, I mean this cannot be impossible right?
      My Computer


  2. Posts : 1,049
    Windows 7 Pro 32
       #2

    To start a Java app for another Java version than the default one, create a batch file and change value for the environment variable JAVA_HOME before calling the specific Java app.

    I'm not sure what Java version is the default one but hopefully the latest one installed. Open a command prompt and type java -version
    Type echo %JAVA_HOME% to see the default value.
    Type set JAVA_HOME=newvalue where newvalue is the path to the other Java versions home folder. Then type java -version again to see if the change worked.

    You might have to change the PATH variable as well if the above doesn't work.
      My Computer


  3. Posts : 1,436
    Windows 7 Home Premium
    Thread Starter
       #3

    Tookeri said:
    To start a Java app for another Java version than the default one, create a batch file and change value for the environment variable JAVA_HOME before calling the specific Java app.

    I'm not sure what Java version is the default one but hopefully the latest one installed. Open a command prompt and type java -version
    Type echo %JAVA_HOME% to see the default value.
    Type set JAVA_HOME=newvalue where newvalue is the path to the other Java versions home folder. Then type java -version again to see if the change worked.

    You might have to change the PATH variable as well if the above doesn't work.
    And what if I have an older one installed but I wanna keep it and install the latest one?

    And well it is a game I'm playing that need to have the older version of java..
      My Computer


  4. Posts : 1,049
    Windows 7 Pro 32
       #4

    Then don't uninstall the older one :) Java 8 and later comes with an option during install to uninstall older Java versions. If you skip that you'll end up with two versions installed. You can verify in the install options where the new version will be installed.

    I don't remember exactly but I assume the newest version will be the default one.

    More info:
    https://www.java.com/en/download/hel...e_download.xml
    https://www.java.com/en/download/faq...erversions.xml
      My Computer


  5. Posts : 1,436
    Windows 7 Home Premium
    Thread Starter
       #5

    Never mind that mark solved, it never gave me the option to uninstall a previous version.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:17.
Find Us