For a beginner, this will be one of the question which they might have. For an expert even though this is well known jar file in Java, very few will know as to what it is and why it is so important. This blog post is a very short post, just giving some details of what rt.jar is and what constitutes Java as a whole (JDK/JRE).
rt.jar contains all the RunTime classes that comprise the Java SE platform’s core API’s. In simple terms this is the jar which contains classes like java.lag.String, java.io package etc. The source code for these API’s can be found in src.zip file in JAVA_HOME.
Since all the classes in the rt.jar are known to the JVM, these classes tend to be left alone with various checks that JVM does while loading these classes onto it. This is also done for various performance reasons. These jars are loaded by primodial class loaders and that’s the reason these classes avoid the basic security checks which the JVM does for other jars/classes.
The base files and folders in the JDK/JRE is shown in the below figure.
Image Courtesy – docs.oracle.com
For more details on all the various files and directories comprising JDK and JRE, i would suggest going through the official Oracle documentation as follows:
As pointed out by one of the reader, since the above link is no longer maintained, the below link which details JDK 1.7 is given:
Page Visitors: 7122