我在我的电脑上安装了Java(JRE位于
C:\Program Files\Java
),但我无法从Windows PowerShell命令提示符中运行任何Java命令。
我电脑上已经安装了Java(JRE位于C:\Program Files\Java
),但我无法通过Windows PowerShell命令提示符来运行任何Java命令。
>>> java -version
java : The term 'java' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ java
+ ~~~~
+ CategoryInfo : ObjectNotFound: (java:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
不过,我注意到Java确实可以工作,并且我可以在旧版的Windows命令提示符中运行Java命令。结果只有PowerShell无法运行这些命令。
我有JRE 7,正在使用Windows 8上的PowerShell。