views:

87

answers:

3

Hi, I was just wondering if there was any way to set to %PATH% variables so I can compile my Java code, along with my Python code?

For instance.. PATH is currently C:\ ... JDK_bin blah blah, and that's it. To run my python code, I have to change my path variable completely.

Any answers?

+8  A: 

Just add a semicolon after your present path, and write the new one after that.

set PATH="C:\Program Files\Java\blah\blah";C:\Python31\;C:\Windows\System32

etc...

Tim Pietzcker
+3  A: 

PATH variables can have multiple paths in them. Separate paths with ; on Windows and : on *nix.

set PATH=c:\path\to\java;c:\path\to\python
Synesso
Oh you are fantastic, thank you both very much!
Jordan Alexander
+5  A: 

You need to add the path to python exe to your existing PATH variable which already has path to Java exes and many more paths in it.

path = %PATH%;C:\path\to\python\bin

You can also do this using windows GUI.

Note that doing an absolute assignment to PATH like

set PATH = C:\path\to\python\bin

will overwrite it, loosing the path(s) it already had.

codaddict