Roy Lee
Roy Lee

Reputation: 329

How to set environment variable PATH to use BOTH JAVA and Python

I can't use Java and Python at the same time.

When I set

%JAVAHOME%\bin; %PYTHONPATH%; 

I can use java, but not python. When I set

%PYTHONPATH%; %JAVAHOME%\bin;

I can use python, but not java.

I'm using windows 7. How can I go about fixing this problem?

Upvotes: 0

Views: 12330

Answers (4)

Anurag Goel
Anurag Goel

Reputation: 468

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:[https://i.sstatic.net/N2C10.png]

Upvotes: 0

SebS
SebS

Reputation: 591

Have you tried removing the space after the semicolon

%JAVAHOME%\bin;%PYTHONPATH%; 

Upvotes: 0

Elliott Frisch
Elliott Frisch

Reputation: 201447

Don't put a space in your PATH entries

set "PATH=%JAVAHOME%\bin;%PYTHONPATH%;%PATH%" 

Upvotes: 4

Dilip
Dilip

Reputation: 2734

  1. Select Start, select Control Panel. double click System, and select the Advanced tab.
  2. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. ...
  3. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.

for more use this link

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

Upvotes: 0

Related Questions