Thursday, January 16, 2014

Class path Setup for Java - Windows

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 machine. You can download from the following URL: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Step 2: By default JDK will be installed 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 underSystem Variablesand enter Variable Name asPATH andVariable Valuesas 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 underUser Variablesand enter User Variable asCLASSand 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.

No comments:

Post a Comment