What is the difference between Path and Classpath?

PATH:
It is a system variable used to tell to OS all locations of exec file.

Setting the PATH in Microsoft Windows XP
1) Right click on My Computer
2) Select Properties
3) Select the Advanced tab.
4) Click the Environment Variables button
5) In System Variable section path variable will be present. Click on edit for
modifying it .
enter variable name:CLASSPATH
value should be your path as c:/program files/java/bin and put semicolonat the end.
6) Click ok.
7) Click ok.
8) Click ok.


CLASSPATH:
It is user management variable, which is used to tell locations of all jar/zip (classes) files to Compiler.

Both PATH and classpath are Environmental variable.

1) Right click on My Computer 4) Select the Advanced tab
2) Select Properties
3) Select the Advanced tab.
5) Click the Environment Variables button
6) Click the New button to create a CLASSPATH or the Edit button to edit an existing CLASSPATH
7) Enter CLASSPATH as the variable name
8) Enter the list of directories or jar files in your CLASSPATH as the variable value, using a semicolon to separate entries in your list.
9) Click OK.
10) Click OK.
11) Click OK.


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email