Firstly, there's the Java code for the Java class library provided by jre/lib/rt.jar
. It is not compiled into native code ahead-of-time, but just-in-time by the Hotspot compiler (if executed a threshold number of times, otherwise an interpreter is used) during JVM startup/execution.
There's an optimization called Class Data Sharing
that parses classes from rt.jar
and stores the internal in-memory class representation used by the JVM in jre/lib/[arch]/[type]/classes.jsa
so that the classes covered do not have to be processed again and again. This file can be shared by multiple JVM instances by means of memory mapping.
Then there's jre/lib/[arch]/[type]/libjvm.so
, which contains the actual JVM code including the Hotspot compiler.
Lastly, there are a number of additional libraries in jre/lib/[arch]
that contain JNI implementations required by the Java class library. For example, libjava.so
contains various JNI exports for the java.lang
and java.io
packages, amonst others.
With Java 9, the Java module system was introduced, which also affected rt.jar
. rt.jar
was replaced with corresponding modules residing in jmods
. Additionally, the architecture was dropped from internal paths and the jre
subdirectory does not exist anymore.
Java 9 also introduced an experimental ahead-of-time compiler that could be used to precompile the Java class library, at least in theory. AFAIK, it's still experimental as of Java 14.