gpt4 book ai didi

java - powershell无法识别java

转载 作者:行者123 更新时间:2023-12-02 02:32:56 25 4
gpt4 key购买 nike

我安装了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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com