The system cannot find the path specified.
JAVA HOME is not set correctly.
当我尝试在 Eclipse 中运行 Web 服务器时出现以下错误:
该系统找不到指定的路径。 JAVA HOME 设置不正确。
但是检查我的环境变量,它们看起来是正确的:
echo %JAVA_HOME%
C:\Program Files (x86)\Java\jdk1.8.0_101
echo %PATH%
C:\ProgramData\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Installation;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\Java\jdk1.8.0_101\bin;C:\ProgramData\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Installation;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\Java\jdk1.8.0_101\bin;C:\ProgramData\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files\Git\cmd;C:\HashiCorp\Vagrant\bin;C:\Installation;C:\Program Files (x86)\Brackets\command;
还有什么我想念的吗?
原文由 En-Motion 发布,翻译遵循 CC BY-SA 4.0 许可协议
检查系统环境变量和用户环境变量……似乎eclipse正在从不同的环境中获取变量……
如果问题仍然存在,则在 eclipse 中设置 JAVA_HOME 以明确告诉 eclipse java 在系统中的安装位置。在 eclispe 中设置 JAVA_HOME 下面给出了几个选项。
要在 Eclipse 中设置 JAVA_HOME,请导航到 Windows 菜单 -> 首选项 -> 添加运行时变量
或者
导航到运行菜单 -> 外部工具配置 -> 导航到环境选项卡 -> 添加 JAVA_HOME 变量及其路径,因为它是在 eclipse 中设置环境变量的值。