Saturday, October 13, 2012

Difference between path and classPath in java

We always set a path and classpath while coding using java.

Path is for the OS to know where the java exe's are. by setting path you can execute java program from anywhere if not set then u need to go to bin directory of java and only then u can execute a java program.
Classpath is for the java program to know where the .class file are.

Classpath location points to where the .class file of your java programs are and /or the jar files (they contain the .class file used to code a specific functionality/usage)

No comments:

Post a Comment