How can I change the Java Runtime Version on Windows (7)?

后端 未结 8 763
后悔当初
后悔当初 2020-12-07 10:02

How can I change the Java Runtime Version on Windows.

I installed Java 7 for some tests, and now I need the old java6 as system default, but I don\'t want to un

8条回答
  •  孤街浪徒
    2020-12-07 10:38

    Since Java 1.6, a java.exe is installed into %windir%\system32 that supports a "-version" command line option. You can use this to select a specific version to run, e.g.:

    java -version:1.7 -jar [path to jar file]
    

    will run a jar application in java 1.7, if it is installed.

    See Oracle's documentation here: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html

提交回复
热议问题