Iftekharul Islam
Iftekharul Islam

Reputation: 25

Path not Found: The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe

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:

enter image description here

From Desktop:

enter image description here

Upvotes: 1

Views: 1729

Answers (2)

NikhilMourya
NikhilMourya

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

Elliott Frisch
Elliott Frisch

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

Related Questions