简体   繁体   English

在 Windows 中,'java' 不是内部或外部命令、可运行程序或批处理文件 10

[英]'java' is not recognized as an internal or external command, operable program or batch file in Windows 10

I know this is a popular question on the web, but I'm getting this error even after setting JAVA_HOME env variable and adding %JAVA_HOME%\bin\ to the Path variable.我知道这是 web 上的一个流行问题,但即使在设置JAVA_HOME环境变量并将%JAVA_HOME%\bin\添加到 Path 变量之后,我也会收到此错误。

I'm trying to use PDF Presenter app which requires Java.我正在尝试使用需要 Java 的PDF Presenter应用程序。 So, I downloaded Oracle JDK ( jdk-14.0.1_windows-x64_bin.exe ) and installed it and then configured the above two variables.所以,我下载了 Oracle JDK ( jdk-14.0.1_windows-x64_bin.exe ) 并安装了它,然后配置了上面的两个变量。

If I enter %JAVA_HOME%\bin\java.exe --version , it works fine.如果我输入%JAVA_HOME%\bin\java.exe --version ,它工作正常。 But if I enter java.exe or java , I get the error in the title.但是如果我输入java.exejava ,我会得到标题中的错误。 How can I fix this?我怎样才能解决这个问题?

Here is the output of echo %PATH%这是echo %PATH%的 output

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;%JAVA_HOME%\bin\;C:\Users\Nagabhushan\AppData\Local\Microsoft\WindowsApps;

If you use the gui of windows for env variable don't use %JAVA_HOME% but the real path.如果您使用 windows 的 gui 作为环境变量,请不要使用 %JAVA_HOME% 而是使用真实路径。 The variable are not interpreted in the gui.该变量不在 gui 中解释。

And in consequence you have %JAVA_HOME% directly in your path who will not be interpreted when you enter your command因此,您的路径中有 %JAVA_HOME% 直接在您输入命令时不会被解释

暂无
暂无

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

相关问题 VSCode 'java' 不是内部或外部命令,也不是可运行的程序或批处理文件 - VSCode 'java' is not recognized as an internal or external command, operable program or batch file 'java' 不是内部或外部命令、可运行程序或批处理文件 - 'java' is not recognized as an internal or external command, operable program or batch file 'appletviewer' 不是内部或外部命令,也不是可运行的程序或批处理文件 - 'appletviewer' is not recognized as an internal or external command, operable program or batch file 'wsgen'不被识别为内部或外部命令,可操作程序或批处理文件 - 'wsgen' is not recognized as an internal or external command, operable program or batch file 'scomp' 不是内部或外部命令,也不是可运行的程序或批处理文件 - 'scomp' is not recognized as an internal or external command, operable program or batch file 'mvn' 不是内部或外部命令,也不是可运行的程序或批处理文件 - 'mvn' is not recognized as an internal or external command, operable program or batch file 错误 -'javac' 不是内部或外部命令,也不是可运行的程序或批处理文件 - Error -'javac' is not recognized as an internal or external command, operable program or batch file 'cmd'未被识别为内部或外部命令,可操作程序或批处理文件 - 'cmd' is not recognized as an internal or external command, operable program or batch file 错误 - jar 不是内部或外部命令、可运行的程序或批处理文件 - Error - jar is not recognized as an internal or external command, operable program or batch file 'jar' 不是内部或外部命令、可运行程序或批处理文件错误 - 'jar' is not recognized as an internal or external command, operable program or batch file error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM