HOW TO SET ENVIRONMENT VARIABLE FOR JAVA

HOW TO SET ENVIRONMENT VARIABLE OF JAVA

If you want to run your java program than you have to set the environment variable. In this we have to set two variables. How to set these two variables that are given below:-

1. From the Desktop right click on the My Computer and click on Properties.
2.After that click on the Advanced System Settings in the left sidebar.

3. In the next we have to click on the environmental variables and after that click on the path name variable and enter the path that is given below:-

C:\Program Files\Java\jdk1.6.0_13\bin
 
4. After set the path variable we have to set the classpath variable in the environment variables. The path of classpath variable is given below:-

C:\Program Files\Java\jre6\lib

Enter this address in the new classpath variable. After adding this variable you can run your java program.

5. You can check you running availability by checking the version of java.That command is given below:-

java -version