How To Set Environment Variable in Windows

Environment Variable helps us to use many commands without specifying full path for its executable file.
Example,
>javac MyClass.java
instead of
C:\Program Files\Java\jdkx.x.x_xx\bin>javac MyClass.java

Why to Set Environment Variable?
Sometimes it becomes very uneasy to use application with absolute path, like in above example each time you will need to copy "MyClass.java" file in bin directory or specify full path for same file.

Alternate Solution
set path="C:\Program Files\Java\jdkx.x.x_xx\bin" 

But this is temporary solution.

Permanently set Environment Variable

Step 1
Right click on My Computer , go for
> Properties > Advance system settings > Environment Variable

Step 2
In System Variables search for "PATH"Select and click "Edit"

Step 3
Put full path of .exe directory at the current value. Include ; (semi-colon) before your new full path each time.





Note: Same for,
"ruby.exe"' is not recognized as an internal or external command,TA: operable program or batch file.
"php.exe"' is not recognized as an internal or external command

No comments :

Post a Comment