Java: System cannot find the file C:\ ... java.exe
Solution 1
Just set %JAVA_HOME%/bin to your path variable.
Solution 2
1.Just go to C:\ProgramData\Oracle\Java\javapath\
2.You will find there shortcuts for java.exe,javaw.exe,javaws.exe which are pointing to a location where they actually are not existing now
3.Go to the jre location where you have installed java like C:\Program Files\Java\jre6\bin
You will find java.exe,javaw.exe,javaws.exe
Create shortcuts for these files and replace with the ones which are present in C:\ProgramData\Oracle\Java\javapath.
It works
rni902
Updated on December 09, 2020Comments
-
rni902 over 3 years
I have installed Java 8 and set my
JAVA_HOME
andJRE_HOME
paths and added%JAVA_HOME%
to the start of thepath
variable.I created a helloworld.java application and am able to compile it using:
javac helloworld.java
However, when I try to run:
java helloworld
I get the error:
The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe
How can I solve this?