why do I get this? How can I fix it?
C:\\Users\\ash>java version
Error: Registry key \'Software\\JavaSoft\\Java Runtime Environment\'\\Cu
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.
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.
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.
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
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"
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;