In java path is the variable which holds the specific location of the binary executable files of java like- java/javac etc
How to set path--
Well there are two ways by which we can set path
- Permanently set path via environment variable-(click here for more)
- Temporary for a session.
1. Go to start-->run -->type cmd
3. Now navigate to the path where you have installed your java(JDK installation folder)
it might be C:\Program Files\java\jdk<<version>>\
5. Type the below written command:
set path=C:\Program Files\Java\jdk1.7.0_21\bin\
you are done!! Now you can write any java program and compile the same.
Classpath is the variable which is used to tell JVM from where all my classes are residing. and from which location it has to pick the required .class files.
How to set classpath:
Please go through ..
for permanent settings
for temporary settings