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

后端 未结 18 2045
长情又很酷
长情又很酷 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:39

    Make sure your JDK Path variable is directing to the \bin folder and is at the top of the list.

    If there's any other entry that has a file called java (such as C:\ProgramData\Oracle\Java\javapath) it will run the command against that file instead of the java file in your JDK. There's no need to reinstall the entire JDK unless your files are corrupt or damaged for some reason.

    0 讨论(0)
  • 2020-11-29 07:41
    1. Uninstall Java from machine
    2. Check Java folder is deleted from Program Files
    3. Check Registry does not have any instance of Java
    4. Open system Variables and delete the ONLY java path from PATH
    5. Now install the new version again.
    6. Set the Path in System Variables.

    This process cleans up all the traces of java and then install fresh java.

    Note: This issues occurs when there is multiple installation and uninstall done.

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

    Reinstall JDK and set system variable JAVA_HOME on your JDK. (e.g. C:\tools\jdk7)
    And add JAVA_HOME variable to your PATH system variable

    Type in command line

    echo %JAVA_HOME%
    

    and

    java -version
    

    To verify whether your installation was done successfully.

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

    I had to remove the Common Files javapath from the 'Path' that was conflicting, in order to make it work. Now thankfully the java -version works just fine.

    C:\Program Files (x86)\Common Files\Oracle\Java\javapath
    
    0 讨论(0)
  • 2020-11-29 07:49

    In my case the regedit information was correct and the problem was solved by doing the below:

    1) setting JAVA_HOME to jdk - set JAVA_HOME=C:\Program Files\Java\\bin 2) setting PATH to jre - set PATH="C:\Program Files\Java\\bin"

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

    I had a similar issue after installing the java 10.0

    To fix this go to Advance System setting --> path and remove

    C:\ProgramData\Oracle\Java\javapath;

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