We all know the importance of CLASSPATH for Java. Setting PATH/CLASSPATH is very easy if we have the correct steps. I've listed down the steps which will help you to set CLASSPATH/PATH for Java:
Step 1: Download Java or JDK from the following URL according to your computer configuration:
Step 2: Install it by click on setup.exe and following the steps.
Step 3: By default JDK installs at "C:\Program Files\Java\jdkxxx.xx" location only. Unless we change the location at the time of installation.
Step 4: Go to JDK installed location, open bin folder available at the location. Now, copy the path.
Step 5: Right-click on My Computer icon available at your desktop and select Properties.
Step 6: Now, click on Advanced System
Settings and click on Advanced tab from the dialog box opened
Step 7: Click on Environment Variables and then System Variables.
Step 8: Edit path and add the copied bin (which
we did in Step 4) in that. Below are some images to help you:
Step 9: Click on OK of Environment Variables window and System Properties window.
Step 10: To verify whether Classpath or path of java is set up correctly or not.
Open Command Prompt and enter java -version. You'll find a statement like mentioned below:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)