I'm trying to create a native-image from a fat jar file with
$ native-image -H:+TraceClassInitialization --initialize-at-run-time=org.slf4j,org.apache.log4j \
-jar ./my-jar-with-dependencies.jar
And I'm getting those error messages like:
Error: Classes that should be initialized at run time got initialized during image building: org.apache.log4j.Level the class was requested to be initialized at build time (from the command line). org.apache.log4j.Level has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try avoiding to initialize the class that caused initialization of org.apache.log4j.Level org.slf4j.log4j12.Log4jLoggerAdapter the class was requested to be initialized at build time (from the command line). org.slf4j.log4j12.Log4jLoggerAdapter has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try avoiding to initialize the class that caused initialization of org.slf4j.log4j12.Log4jLoggerAdapter org.apache.log4j.Logger the class was requested to be initialized at build time (from the command line). org.apache.log4j.Logger has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try avoiding to initialize the class that caused initialization of org.apache.log4j.Logger
What are the ways and approaches to avoiding to initialize the class
issues? How can I deal with those messages?
My graavlVM version is 2.0.0-java11