Specify Class Initialization Explicitly
Two command line flags explicitly specify when a class should be initialized:
You can use the flags to specify whole packages or individual classes.
For example, if you have the classes
p.C2, … ,
p.Cn, you can specify that all the classes in the package
p are initialized at build time by passing the following argument to
native-image on the command line:
If you want only one of the classes in package
p to be initialized at runtime, use:
The whole class hierarchy can be initialized at build time by passing
--initialize-at-build-time on the command line.