Properly installing java 8 along with java 7

前端 未结 10 1165
无人共我
无人共我 2020-12-04 12:52

I\'ve JDK 1.7 installed on my windows 7 machine and after installing JDK 1.8 u20 I\'m having following error:

C:\\>java -version
Error: Registry key \'Sof         


        
相关标签:
10条回答
  • 2020-12-04 13:28

    Thanks @Chris, for me it was solved just deleting the files from C:\Windows\System32.

    I got this problem when using the Sencha Command, but of course it has nothing to do with Sencha. It is a Java installation issue.

    Apparantely this issue was also really annoying for people with Java 1.6 and 1.7 according to this post: Registry Key '...' has value '1.7', but '1.6' is required. Java 1.7 is Installed and the Registry is Pointing to it

    0 讨论(0)
  • 2020-12-04 13:29

    This issue is annoying when dealing with multiple JDKs for developing on Windows 10 (I couldn't make use of the OS system path change as suggested here).

    As a partial answer (since this might not be intended as 'properly' installed) I'm doing quite fine using Cygwin to switch JAVA_HOME and run Maven builds with different JDKs (1.7,1.8) installed (via Oracle installers). So if you have Cygwin installed (or can install and use it) and willing to use JAVA_HOME env variable (useful with Maven as in this example below) you could do like this (BUT be aware of the 'trick' in the answer at link 1 and adjust your local paths accordingly):

    export JAVA_HOME=/cygdrive/c/Progra~1/Java/jdk1.8.0_74
    

    (mvn --version output)

    Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) Maven home: C:\Work2\bin\apache-maven-3.3.9-bin\apache-maven-3.3.9 Java version: 1.8.0_74, vendor: Oracle Corporation Java home: C:\Progra~1\Java\jdk1.8.0_74\jre Default locale: it_IT, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

    export JAVA_HOME=/cygdrive/c/Work2/bin/Java/jdk1.7.0_79_64bit/
    

    (mvn --version output)

    Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) Maven home: C:\Work2\bin\apache-maven-3.3.9-bin\apache-maven-3.3.9 Java version: 1.7.0_79, vendor: Oracle Corporation Java home: C:\Work2\bin\Java\jdk1.7.0_79_64bit\jre Default locale: it_IT, platform encoding: Cp1252 OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

    https://stackoverflow.com/questions/14567191/export-java-home-with-spaces-in-cygwin

    0 讨论(0)
  • 2020-12-04 13:31

    Edit this text in base your own values, save as ".reg", execute, enjoy :)

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0_74]
    "JavaHome"="C:\\Program Files\\Java\\jre8"
    
    0 讨论(0)
  • 2020-12-04 13:35

    I had the same problem then realized my program was running out of c:\Windows\SysWOW64 and hence running the old java.exe. Once I stopped running out of that directory (which contains the Java 7 exe), the problem went away since it followed the path properly to java8.

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