简体   繁体   English

找不到路径:系统找不到文件 C:\\ProgramData\\Oracle\\Java\\javapath\\java.exe

[英]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 ! java & java -version命令可从JDKbin文件夹访问,但我无法从桌面或其他任何地方访问它们,但程序在IDE 中成功运行! What should I do?我该怎么办?

Inside the JDK bin folder:在 JDK bin 文件夹中:

在此处输入图片说明

From Desktop:从桌面:

在此处输入图片说明

JAVA_HOME is used by third-party tools to find java (not by java itself). JAVA_HOME被第三方工具用来查找java (不是java本身)。 You can use that to set your PATH , which is what is searched.可以使用它来设置您的PATH ,这是搜索的内容。

set "PATH=%JAVA_HOME%\bin;%PATH%"

Note that the quotes are correct in this command and moving (or removing) them will break it.请注意,此命令中的引号是正确的,移动(或删除)它们会破坏它。

"The system cannot find the file c:\\ProgramData\\Oracle\\Java\\javapath\\java.exe" “系统找不到文件 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 eg .symlink)步骤 1:转到C:\\ProgramData\\Oracle\\Java\\javapath并检查java.exejavaw.exejavaws.exe (您可能会发现类似的文件名但具有不同的扩展名,例如 .symlink)

Step 2: If you found the file name with different extension and size up to 0kb then delete it permanently.第 2 步:如果您发现文件名具有不同的扩展名且大小最大为 0kb,则将其永久删除。

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步骤 3:转到C:\\Program Files\\Java\\jdk1.8.0_101\\bin并搜索java.exejavaw.exejavaws.exe这三个文件名

Step 4: Copy and Paste those three files in this location C:\\ProgramData\\Oracle\\Java\\javapath第 4 步:将这三个文件复制并粘贴到此位置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第 5 步:关闭所有与 Java 相关的应用程序,例如 IDE 或 cmd 并重新启动 PC,然后尝试编译并运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM