The JVM is capable of loading classes or files from a jar file without extracting the jar to temp files.
This functionality is also available to you in the standard library, see the JarFile
for more information.
So no, the JVM does not extract a jar to temp files, classes (and resources) are simply loaded on demand.
A jar file is basically a zip file with a predefined entry "META-INF/MANIFEST.MF"
(this is only mandatory in case of an executable jar). This MANIFEST.MF
entry (file) contains some information read by the JVM. More on the Manifest files:
Working with Manifest Files: The Basics
In case of an executable jar the Manifest file also contains the main class that should be loaded and whose public static void main(String[])
method to be called in order to start the application. The Main-Class
manifest entry specifies the main class:
Main-Class: classname