Java is not like the others.
Java depends on an environment variable called CLASSPATH, that variable tells the Java Virtual Machine (the thing that runs Java, invoked by the command "java" on the commandline) where all Java-classes are located.
Classes can be separate .class-files in directories, or bundled together in .jar- (or .zip-)files.
To fully explain what packages really are, I could go on and on, but this is what packages are in the file-system (since that seems to be more to the question): Packages are directory trees with classes in the right directories. You were interesed in java.sql, that would be the "java/sql" directory (most probably inside a .jar-file).
So where do the classes reside? Well first of all there in a .jar-file, and the .jar-file can be located anywhere as it's in the classpath.
To set up the CLASSPATH variable to that it includes a specific .jar-file do this: go to the terminal and type "pico ~/.tcshrc", you might have edited this file at another time, if not, it is created. Then you add a line that says:
Code:
setenv CLASSPATH "/path/to/jar/file.jar"
If you want to add another .jar-file or a directory which is the root of a package hierarchy (the directory where the "com" directory is located if your package is called "com.example.java"). Do add this line after the first:
Code:
setenv CLASSPATH "${CLASSPATH}:/path/to/another/jar/file.jar:/path/to/directory"
I have my classes and .jar-files in ~/Library/Java.
/Library/Java/Extensions is for system wide Java extensions, and I think it's only writable by root... I like to keep everything to my home directory, so that I can move that around without breaking anything. My classes goes in my library, "system" classes can go in the system library. Whatever. The benefit of the extensions directory is that you don't have to worry about the classpath.