我无法让 Path 识别 Java SDK

我无法让 Path 识别 Java SDK

好的,我正在尝试通过 CMD 访问 Java SDK 工具(例如 JavaC),但是无法访问。

这是我的回显%path%C:\ Users \ msivri> echo%PATH%

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind owsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\; c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Mic rosoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\10 0\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\T ools\Binn\;

这是我的 PATH 系统变量包含的内容:

C:\Program Files\Java\jdk1.7.0_40\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows 性能工具包\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;

请注意,由于某种原因,它们都是不同的......

答案1

听起来好像您通过 Windows 修改了系统变量,并且已经打开了命令提示符。

请注意,您对系统/环境变量所做的更改不会应用于已打开的 cmd.exe 提示,但将应用于所有新实例。

另外,将更具体的路径放在 PATH 的末尾而不是开头也是一个好主意,当您在提示符下键入命令时,搜索顺序是首先检查当前工作目录,然后按顺序检查路径中的每个项目。因此,对于如上所示的路径,如果您键入“notepad.exe”,它将首先检查您当前的工作目录,然后是 Java bin 目录,最后是您的 C:\Windows\System32 目录。因此,一般来说,您现在键入的每个命令都会稍微慢一点,因为它会首先检查 Java bin 目录中的命令...

相关内容