views:

248

answers:

4

I want to see all the java packages. Where are the packages stored in my machine? Can anyone help. I did search in jdk folder and found awt.dll and all. But its only a few. Can i see all of them?

+3  A: 

You can try unzipping/unjarring rt.jar, which is usually available in $JAVA_HOME/lib/rt.jar. The jar file should include the classfiles of all the JDK, if that is what you are asking about.

notnoop
+10  A: 

If you want a list of packages in the standard installation, just go to the Javadocs and look in the upper left corner.

If you want to see the .class files, they're in lib\rt.jar in the JRE directory (.jar is the same as .zip, so you can open it with anything that can open zip files).

If you want to see the source code, look in src.zip in the JDK directory. If it's not there, you probably elected not to install it when you installed the JDK.

Keep in mind that packages are represented as folders on disk, so you might be a little disappointed by what you see.

Michael Myers
+2  A: 

Assuming you mean the packages that include the class libraries like java.lang.* and java.util.*, these live in the "lib" directory under wherever your Java Runtime Environment (JRE) is installed.

On Windows, it would be something like this:

C:\Program Files\Java\j2re1.4.2_12\lib

In there, you should see files like rt.jar which contains the core Java classes and charsets.jar which contains many of the extended encoding support for EBCDIC and the CJK languages.

In a parallel bin directory are the executables for Java and related utilities.

If you've installed the Java Development Kit (JDK), in the directory above where you find the libs you will probably find a src.jar file. This can be unpacked either with the jar.exe utility, or with a standard zip-style tool, and contains the Java sources to the standard class library.

Some of Java, such as the virtual machine itself, is machine-specific, and will be part of some of the DLL's or EXE's present.

lavinio
+1  A: 

My JDK 1.6.0_13 has a src.zip containing all the source code. Give that a look.

duffymo