Reputation: 9
Okay I need both java and C compilers to work on my pc.
So I have set the path variable of C and now I need to set java's path, so for that can I set the path variable of java in the same PATH
(where I set path for C) or do I need to create a separate PATH
for setting it up? Some one please help.
If I set both in a same path, then will anything go wrong? Sorry I am new to this, please bear with me. Thanks
Upvotes: 0
Views: 181
Reputation: 12890
I am introducing you to what is
PATH
variable ?
PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.
On POSIX and Unix-like operating systems, the $PATH variable is specified as a list of one or more directory names separated by colon (:) characters
On DOS, OS/2, and Windows operating systems, the %PATH% variable is specified as a list of one or more directory names separated by semicolon (;) characters.[3]
Note : The above is an excerpt from WIKI
For Windows, you can set the path
SET PATH=%PATH%;%MINGW_HOME%\bin;%JAVA_HOME%\bin
For Unix-like operating systems, you can do
SET PATH=%PATH%;\home\%MINGW_HOME%\bin;\home\%JAVA_HOME%\bin
Upvotes: 0
Reputation: 22867
It would matter if there were any name collisions. To my knowledge there's no such, but since there are many C compilers and much more stuff for them, and the most important java stuff starts with 'java', just add the Java path AFTER the gcc/mingw path
SET PATH=%PATH%;%MINGW_PATH%\bin;%JAVA_PATH%\bin
Upvotes: 1