与Windows路径变量中的Java "bin"目录混淆 - 如何解决此问题?



所以在运行Windows Server 2008 x64 R2的服务器上,我安装了Java JDK 7 Update 5。我将"C:\Program Files\Java\jdk1.7.0_05\bin"添加到系统"路径"变量中。

现在在控制台中,某些 Java 可执行文件(如 java.exe)可以工作,但其他像 javac.exe 只有在我实际处于该"bin"目录中时才有效。

有没有人知道我做错了什么以及如何解决这个问题?

编辑:每当我输入"javac"时,它都会返回:

'javac' is not recognized as an internal or external command,
operable program or batch file.

当我输入"路径"时,我得到:

PATH=C:PROGRA~2PARALL~1PleskADDITI~1Perlsitebin;C:PROGRA~2PARALL~1Ples
kADDITI~1Perlbin;C:Program Files (x86)ParallelsPleskMail ServersMail Ena
bleBIN;C:Program Files (x86)ParallelsPleskAdditionalPythonScripts;C:Prog
ram Files (x86)ParallelsPleskAdditionalPython;C:zpanelbinapachebin;C:z
panelbinmysqlbin;C:zpanelbinphp;C:zpanelbinwget;C:zpanelbinbindbin;
C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32Wind
owsPowerShellv1.0;c:Program FilesMicrosoft SQL Server100DTSBinn";C:Progr
am FilesMySQLMySQL Server 5.5bin;C:Program Files (x86)ParallelsPleskMail
ServersMail EnableBIN64;C:Program FilesTortoiseSVNbin;C:Program Files (x86
)Gitcmd;C:Program FilesSlikSvnbin;C:Program FilesJavajdk1.7.0_05bin;

还创建一个环境变量JAVA_HOME,路径指向 Java

试试这个,

例如:

我的

JDK位于我的C:\Program Files\Java

因此,您必须执行以下操作:

Copy C:Program FilesJavajdk1.7.0bin , then goto your "Path" variable and set this...

And yes.. open you command prompt and give the following command..

GP更新/强制

最新更新