我安装了java 12。我在power shell中输入java version来检查它是否安装。它给了我:
PS C:\Users\17692> 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 -version
+ ~~~~
+ CategoryInfo : ObjectNotFound: (java:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Power shell 无法识别 java。我该怎么办?
最佳答案
看来你没有正确设置环境变量。您需要进入Windows的高级设置,根据您的需求设置环境变量,并将该环境变量设置为PATH。
以下指南将通过屏幕截图帮助您设置 JAVA_HOME 变量。
https://javatutorial.net/set-java-home-windows-10
完成所有步骤后,我建议您重新打开 PowerShell。
希望对您有所帮助。
关于java - powershell无法识别java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57220402/