I am on JDK 8u25 on Windows 8, and I am experiencing a problem with my Java installation. I can run javac
perfectly fine, but running java
produces this error message:
The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe
How do I fix this?
I think the problem has to do with my environment variables.
The important variables, as I have set them, are:
JAVA_HOME
–C:\Program Files\Java\jdk1.8.0_25
CLASSPATH
–.;%JAVA_HOME%\lib
PATH
–<other paths omitted>;%JAVA_HOME%\bin
And their expansions, as viewed with set
in cmd, are:
JAVA_HOME
–C:\Program Files\Java\jdk1.8.0_25
CLASSPATH
–.;C:\Program Files\Java\jdk1.8.0_25\lib;%CLASSPATH%;
PATH
–C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.6.0_45\bin;<other paths omitted>;C:\Program Files\Java\jdk1.8.0_25\bin
The full output of set
can be viewed here.