如何设置环境变量PATH以使用BOTH JAVA和Python

时间:2015-01-06 06:09:37

标签: java python environment-variables

我不能同时使用Java和Python。

当我设置

%JAVAHOME%\bin; %PYTHONPATH%; 

我可以使用java,但不能使用python。当我设置

%PYTHONPATH%; %JAVAHOME%\bin;

我可以使用python,但不能使用java。

我正在使用Windows 7.如何解决此问题?

4 个答案:

答案 0 :(得分:4)

请勿在{{1​​}}条目中添加空格

PATH

答案 1 :(得分:0)

  1. 选择开始,选择控制面板。双击“系统”,然后选择“高级”选项卡。
  2. 单击“环境变量”。在System Variables部分中,找到PATH环境变量并选择它。 ......
  3. 在“编辑系统变量”(或“新建系统变量”)窗口中,指定PATH环境变量的值。
  4. 更多使用此链接

    http://docs.oracle.com/javase/tutorial/essential/environment/paths.html

答案 2 :(得分:0)

您是否尝试删除分号后的空格

%JAVAHOME%\bin;%PYTHONPATH%; 

答案 3 :(得分:0)

Select Start, select Control Panel. double click System, and select the Advanced tab.
Click Environment Variables. In the section System Variables or User Variable, find
the PATH environment variable and edit it.and write the path of your compiler like this way:

Assume that your
 java compiler path is:D:\java\bin
 python compiler path is:C:\python27
 so you have to set your User or System like variables like this:

Variable name:PATH
Variable value:D:\java\bin;C:\python27

You don't have to leave any space between the paths and you can add as many 
path as you want

Have a look at this:[http://i.stack.imgur.com/N2C10.png]