Reputation: 25
java & java -version commands are accessible from the bin folder of JDK, but I can not access them from desktop or anywhere else, but the programs are running successfully in IDE! What should I do?
Inside the JDK bin folder:
From Desktop:
Upvotes: 1
Views: 1729
Reputation: 11
"The system cannot find the file c:\ProgramData\Oracle\Java\javapath\java.exe"
There are steps to solve the problem which are
Step 1: GO TO C:\ProgramData\Oracle\Java\javapath
and check for the java.exe
, javaw.exe
and javaws.exe
(You may found similar file name but with a different extension for e.g .symlink)
Step 2: If you found the file name with different extension and size up to 0kb then delete it permanently.
Step 3: GO TO C:\Program Files\Java\jdk1.8.0_101\bin
and search for those three file names which are java.exe
, javaw.exe
and javaws.exe
Step 4: Copy and Paste those three files in this location C:\ProgramData\Oracle\Java\javapath
Step 5: Close all your application related to java like your IDE or cmd & Restart PC and then try compile and run
Upvotes: 1
Reputation: 201477
JAVA_HOME
is used by third-party tools to find java
(not by java
itself). You can use that to set your PATH
, which is what is searched.
set "PATH=%JAVA_HOME%\bin;%PATH%"
Note that the quotes are correct in this command and moving (or removing) them will break it.
Upvotes: 2