Reputation: 4089
Java's jar file format builds off of the zip file format, and supports compression of the class files inside it. When and how does the JVM decide which class files to uncompress and pull out of the jars on its classpath? Is the process dynamic and done at runtime as classes are needed, or are they all uncompressed up front before the program actually runs?
Upvotes: 6
Views: 698
Reputation: 36349
Is the process dynamic and done at runtime as classes are needed
Yes. You can log the activity of the class loader as follows (in the terminal):
java -verbose:class [ your other flags and arguments... ]
Upvotes: 5