Tuesday, December 24, 2013

Difference between Path and CLASSPATH

Path -> all the operating system application executable paths should be there.

CLASSPATH -> is specific to JAVA only. The compiled .class file should be present in the CLASSPATH location specified in the environment variables so as to get it executed from cmd prompt.
CLASSPATH should be set for the java file(in the environment variable) if we are executing the java class from cmd prompt. CLASSPATH should contain the path of the generated .class file.

When the jdk is first time installed to a m/c, user should put the jdk path upto bin in the 'Path' variable as jdk is an app for OS.

JAVA_HOME -> is used to replace the path till jdk ../../bin or lib in tomcat run.bat,etc