Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does Java's JVM unzip jar files?

Tags:

java

jvm

jar

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?

like image 573
TwentyMiles Avatar asked Oct 15 '22 05:10

TwentyMiles


1 Answers

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... ]
like image 82
Ingo Avatar answered Oct 20 '22 16:10

Ingo