Lets see how to add a directory to your PATH variable in the Windows command prompt. You will have to do this probably when you need to compile a program code using the command prompt.
For an example assume that you have to compile a Java code. For that you should have the Java bin directory in the PATH when you compile, in order to use the command, say, javac Hello.java.
So this is how the directory path is added to the PATH environment variable.
Temporary
When you enter this command, the directory will be in the PATH only when the command prompt is up and running. When you close the command prompt, the path to the directory will not be in the PATH variable. You will have to add it again the next time.
set path=%path%;C:\Program Files\Java\jdk1.8.0_40\bin
(This is the path to your directory)
Permanent
To permanently add the directory to the PATH environmental variable, use this command.
setx path "%path%;C:\Program Files\Java\jdk1.8.0_40\bin"
(This is the path to your directory)
Comments
Post a Comment