英文:
Running java.exe from Windows cmd.exe
问题
我想从我的系统中的JDK目录运行 java -jar
:
D:\Users\djpastis\Downloads\fmw_12.2.1.4.0_wls_Disk1_1of1>C:\Program Files\Java\jdk1.8.0_162\bin\java
但是我遇到了这个错误,即使路径是正确的:
'C:\Program' 被识别为内部或外部命令、可执行程序或批处理文件的命令。
英文:
I want to run java -jar
from the JDK directory on my system:
D:\Users\djpastis\Downloads\fmw_12.2.1.4.0_wls_Disk1_1of1>C:\Program Files\Java\jdk1.8.0_162\bin\java
but I have this error, even the path is OK
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
答案1
得分: 4
Paths containing special characters, such as a SPACE, must be quoted. Microsoft put a SPACE characters in there for you. The only reliable, safe way is to always quote paths.
"%ProgramFiles%\Java\jdk1.8.0_162\bin\java.exe"
英文:
Paths containing special characters, such as a SPACE, must be quoted. Microsoft put a SPACE characters in there for you. The only reliable, safe way is to always quote paths.
"%ProgramFiles%\Java\jdk1.8.0_162\bin\java.exe"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论