The Java Language Specification states
The Java Virtual Machine dynamically loads, links and initializes classes and interfaces. Loading is the process of finding the binary representation of a class or interface type with a particular name and creating a class or interface from that binary representation. Linking is the process of taking a class or interface and combining it into the run-time state of the Java Virtual Machine so that it can be executed. Initialization of a class or interface consists of executing the class or interface initialization method
<clinit>
(§2.9).
That last part, the <clinit>
, is where your static
initializers are run.
The java
launcher option you used
-verbose:class
simply
Displays information about each class loaded.
So your class is loaded as part of the web application loading the classpath entries, but it isn't initialized until Jetty instantiates it so that it can use the object to handle a request.