Classpath Setup for Java - Windows

Purpose: Classpath Setup for Java - Windows 7

We all know the importance of CLASSPATH for Java. Setting PATH/CLASSPATH is very easy but some of us facing difficulties. For them I want to contribute from my blog. Following steps will provide how easy we can set CLASSPATH/PATH for Java.


Step 1: Download and install Java if not available on your box. You can download from the following URL:
http://www.oracle.com/technetwork/java/javase/downloads/index.html

Step 2: By default JDK will be install at "C:\Program Files\Java\jdkxxx.xx" location only. Unless we change the location at the time of installation this is the default location.

Step 3: Go to JDK installed location and you will find bin folder and open that one. copy the bin folder path.




Step 4: Right Click on My Computer and Select "Properties". Once the Propertieswindow is opened click on Advanced System Settings.

Step 5: Once Advance System Settings window is opened click on Environment Variables option



Step 6: Once Environment Variables window is opened click on New under System Variables and enter Variable Name as PATH and Variable Values  as Path of Java Bin Folder(previously copied path) and click OK




Step 7: Go to JDK folder -> open lib folder and copy the path

 


Step 8: Repeat the steps 4 and 5. Now click on New under User Variables and enterUser Variable as CLASS and Variable Values as Path of the lib folder and click on OK




Step 9:  Click on OK of Environment Variables window and System Properties window

Step 10: Open Command Prompt and run any java program and you are able to successfully complete.