本文介绍了MinGW和JDK在路径中互相禁用对方的可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有以下设置仅在系统变量中(我的用户变量不包括JDK或MinGW地址)。我有一个 JAVA_HOME 环境变量设置如下:
JAVA_HOME - C :\Program Files\Java\jdk1.8.0_66



(这产生的行为与我写的地址相同当我的路径变量以%JAVA_HOME%\bin开头时,$ / $ C:\MinGW\bin; ... 我在cmd中获取正确的 javac 访问权限,但不是 gcc g ++ 的作品。
通常的错误信息:

当我的路径变量以 C:\MinGW\bin %JAVA_HOME%\bin; ... 我正在工作 gcc 命令,但现在 javac 是无法识别的...

And when my path variable begins with C:\MinGW\bin; %JAVA_HOME%\bin; ... I get working gcc commands but now javac is unrecognized...

How can I solve this problem?

(I'm trying to set up an environment for Eclipse to develop to Android with cocos2d-x, I use MinGW v4.8.1, JDK 1.8 x64 and Win v8.1 x64)


My full path looks like this:

%JAVA_HOME%\bin;
C:\MinGW\bin;
C:\ProgramData\Oracle\Java\javapath;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;
C:\Program Files (x86)\CMake\bin;
C:\Program Files\TortoiseHg\;
C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;
C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;
C:\Program Files (x86)\GtkSharp\2.12\bin;
C:\Program Files (x86)\Skype\Phone\

Where javapath indirectly points to JRE exe's.

Edit:
jdk1.7.0_79 x64 produces the same result (I'm sticking with 1.7 from now on)

Edit:
I reinstalled mingw, nothing changed. If the jdk address precedes the mingw address, all mingw executables become unreachable, vica-versa, this is killing me :(

I tried many variations, the path to JRE must precede the path to MinGW, otherwise I can't even call "java" from cmd, however it doesn't disable MinGW's exe's like the JDK does.

So this variation for example still hides all of MinGW exe's from The Path:
C:\Program Files\Java\jre1.8.0_66\bin;
C:\Program Files\Java\jdk1.7.0_79\bin;
C:\MinGW\bin;etc...

解决方案

Oh.. My.. God... Windows - only the first entry of PATH-environment variable can be found

THE SPACES!!! DON'T PUT SPACE AFTER A SEMICOLON!!

(Whoever created environment variable editing UI (especially the parsing), along with MSVS's inclusion/linkage editing, should be CENSORED)

这篇关于MinGW和JDK在路径中互相禁用对方的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 15:42