Error when checking Java version: could not find java.dll

后端 未结 18 2046
长情又很酷
长情又很酷 2020-11-29 07:29

why do I get this? How can I fix it?

C:\\Users\\ash>java version
Error: Registry key \'Software\\JavaSoft\\Java Runtime Environment\'\\Cu         


        
相关标签:
18条回答
  • 2020-11-29 07:50

    None of the above worked for me, unfortunately. The error solved when I uninstalled the old JDK versions that were installed on my computer. I did it simply with the "Uninstall or change a program" tool (under the Control Panel).

    0 讨论(0)
  • 2020-11-29 07:53

    You could be using a 32 bit version of java on a 64 bit environment. Export the registry hive form HKLM\Software\JavaSoft and import into HKLM\Software\Wow6432Node\JavaSoft. For 1.6 I only needed JavaHome and RuntimeLib values.

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Runtime Environment]
    "CurrentVersion"="1.6"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Javasoft\Java Runtime Environment\1.6]
    "JavaHome"="C:\\Java\\jre"
    "RuntimeLib"="C:\\Java\\jre\\bin\\client\\jvm.dll"
    
    0 讨论(0)
  • 2020-11-29 07:55

    Removing

    C:\ProgramData\Oracle\Java\javapath;

    work like charm

    0 讨论(0)
  • 2020-11-29 07:57

    I removed the "C:\Program Files (x86)\Heroku\bin" from PATH variable and the problem has gone. I think it is probably the Heroku require different version of Java. So check all directories in your PATH variable, remove the possible ones may have confliction.

    0 讨论(0)
  • 2020-11-29 07:58

    The accepted solution for Reinstalling ALL JDKs was a bit harsh. I too experienced this problem and here is my 2 cents:

    This problem started happening since I installed JDK 8 and still had JDK 6 installed. I need for different projects I'm working on.

    I noticed I had both a User and a System %JAVA_HOME%, so I removed my User %JAVA_HOME% variable and left only the system one.

    I also noticed that in my Oracle installation there was some Java executables and I believe those where the ones conflicting since both my Oracle and Java installations were in my %PATH% variable.

    I removed all Java paths from my %PATH% Variable and only left the %JAVA_HOME%\bin at the start of the variable for avoiding any conflicts with the Oracle installation.

    0 讨论(0)
  • 2020-11-29 07:59

    Problem: We had the same problem in our Windows 2012 server. We used JAVA_HOME environmental system variable, an we used in the PATH this kind of settings: ...%JAVA_HOME%/bin;... and no other java related settings was in the PATH.

    The problem was we had a space at the end of the value of the JAVA_HOME variable. Like 'C:\Program Files\Java\Jdk 1.8.0_172 ' so the %JAVA_HOME%/bin meant 'C:\Program Files\Java\Jdk 1.8.0_172 \bin'. So because the value was split by space and the system tried to find java.exe at 'C:\Program Files\Java\Jdk 1.8.0_172' where it is obviously not.

    Solution was: Delete the space from the end of value of the JAVA_HOME !

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