I'm confused in understanding, how java interpretor and java compiler searches for all the necessary jar files it requires from environment variables. As I have only set the set path variable for JDK directory, but I've not set any variable to search for any class libraries, which jvm requires. How can it search those important jar files?
+1
A:
CLASSPATH is an enviromental variable is like the path file (which helps windows to find executables). It lists a set of all places the JVM looks for classes. You can also give the classpath on the command line when starting the jvm and java compiler
Thirler
2010-02-04 08:34:07
+3
A:
Which jar files are you talking about? Java already knows about the jar files it "owns" (such as rt.jar) - you don't have to tell it about them explicitly. This is known as the bootclasspath - you can override it, but usually you don't want to.
Jon Skeet
2010-02-04 08:35:08
+2
A:
For better understanding of how classes are found and loaded by JVM read this.
http://java.sun.com/j2se/1.3/docs/tooldocs/findingclasses.html
Chandru
2010-02-04 10:20:23
+1, but more recently: http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html
trashgod
2010-02-04 17:24:54
@trashgod Thanks for pointing that out.Didn't notice that it was for 1.3. :( But most of the concepts still hold true thanks to Java's backward compatibility.
Chandru
2010-02-04 17:56:48