Tech Me More

To quench our thirst of sharing knowledge about our day to day experience & solution to techincal problems we face in our projects.

Advertise with us !
Send us an email at diehardtechy@gmail.com

Tuesday, September 2, 2014

How to set path and classpath variable permanently in java.

To work with java permanent setting of path and classpath variable is very necessary for smooth execution of all the java programs.

To make it easy for you we have given a screen shot of every step.

How to set path variable.

  1. Right click on "My Computer"--> Click on "Properties".
    click on properties.
    once you click on properties below window opens

                              
  2. Click on Advanced system settings in the left. It opens a below window.


  3. Click Environmental variables , which will open a below window.


  4. click new and in the variable name field type as "path".


  5. In variable value field enter the path of your bin folder.
    Usually bin folder in located in C:\Program Files\Java\jdk1.8.0_05\bin
  6. Click OK.

How to set classpath variable.


  • Repeat step 1 to step 3 as above.

  • in variable name field type as "classpath"

  • In variable value field enter the path of rt.jar and tools.jar of jdk.
Example: Value of classpath variable looks like below given value. 

.;C:\Program Files\Java\jdk1.8.0_05\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_05\lib\tools.jar


Note : "." (dot) represents the current working directory and therefore must be placed in the starting of classpath variable value field as shown above.

No comments: