How to set path for Jre 6 when jre 7 installed?

前端 未结 12 804
深忆病人
深忆病人 2021-01-18 00:19

I am programming through java 1.6 u_17, but i have JRE version 6 and JRE version 7 installed, so how to run my compiled program from JDK 1.6 to run through the JRE 6 only?<

相关标签:
12条回答
  • 2021-01-18 00:33

    For windows 7(X86) path setting:

    first step: Mycomputer(Right click)-->properties-->advanced settings-->environment variales-->new (user variable)

    on this first varible name: "" JAVA_HOME "" value: "" C:\Program Files\Java\jdk1.7.0_45 ""

    second variable name: "" PATH "" value: "" C:\Program Files\Java\jdk1.7.0_45\bin;.; ""

    0 讨论(0)
  • 2021-01-18 00:34

    There are two types of path for java : Permanent & Temporary.

    Here is the video tutorial describing how to set path for Java?

    How to Set path for Java : https://www.youtube.com/watch?v=rM4Qq3Ua7Sk

    This video tutorial will guide you in setting permanent and temporary path for Java. Simply follow the steps. This will work with any version of Java, JDK or JRE. In video I have used path of JDK, Simply copy path of JRE instead of JDK and rest is same.

    OR read the tutorial here : How to Set path for Java : http://aatul.me/2011/08/24/how-to-set-path-for-java/

    Hope this solutions will help you.

    0 讨论(0)
  • 2021-01-18 00:40

    I was facing the similar problem. I am using Java 7 and Java 8 together. The Java 8 was installed in the machine but the 7 set-up I copied from another system. I have already set the JAVA_HOME & path pointing to 7. But when I try to echo %path%, it shows the Jdk 8 in the class path. after lots of google, I have found "C:\ProgramData\Oracle\Java\javapath" in the path. Removing the line from the path solved the problem.

    0 讨论(0)
  • 2021-01-18 00:42

    Looks like you are using Windows. Please go the Environment Variables and define a user variable as:

        Right Click(My Computers) -> Advanced -> Environment Variables -> Add
    
        Variable Name = JAVA_HOME
        Variable Value = Root Folder of Java 1.6.0_17 installation
    

    Also in the same screen, please check the PATH variable and make sure **bin** Folder of Java 1.6.0_17 installation is added in the path preferably in the beginning and remove the Java 7 from the path, if it is there.

    0 讨论(0)
  • 2021-01-18 00:42

    For those who had the same problem I suggest reading this thread:

    https://superuser.com/questions/479889/wrong-java-version-being-reported

    Quote of wmz: "To check what actually executes when you run 'java -version' run from command line: for %I in (java.exe) do @echo %~$PATH:I"

    0 讨论(0)
  • 2021-01-18 00:46

    I fix this problem by removing the java.exe in system32 folder. And then in the cmd the java command refer to the jdk set in the path enviroment variable.

    0 讨论(0)
提交回复
热议问题