Java and Database Connectivity
|
The classpath and using archives
How does Java find the classes it needs?
-
Source files are compiled into class files
-
Class files are kept in directories whose path structure
reflects the package name
-
uk.co.weft.clock.BatonHand is stored in
uk/co/weft/clock/BatonHand.class
-
The directories may be packed up
-
into 'java archives' ('JAR files')
-
or ZIP archives
-
A special environment variable called
CLASSPATH tells Java where to look for these
directories and archives