I am developing a command line app with freemarker. I want to build the app as a graalvm native image using the native-maven-plugin. When I start the app on the command line (zsh on MacOS), I get the following warning:
Aug. 01, 2024 10:25:29 PM freemarker.log._JULLoggerFactory$JULLogger warn
WARNUNG: Seems that the Java 9 support class (freemarker.core._Java9Impl) wasn't included in the build
Aug. 01, 2024 10:25:29 PM freemarker.log._JULLoggerFactory$JULLogger warn
WARNUNG: Seems that the Java 16 support class (freemarker.core._Java16Impl) wasn't included in the build
I have already tried to include the two classes _Java9Impl
and _Java16Impl
in the image using the native image build option --initialise-at-build-time=org.freemarker._Java9Impl
. Without success.
I have also tried to simply use the two classes in my application so that they are included in the native image. To do this, I added the following code to my app, which actually makes no sense:
_Java9 j9 = _Java9Impl.INSTANCE;
_Java16 j16 = _Java16Impl.INSTANCE;
if (LocalDate.now().isBefore(LocalDate.of(1970,1,1))) {
System.out.println(j9.toString() + j16.toString());
}
Unfortunately without success, the two warnings are still displayed. What do I have to do to make the two warnings disappear?
Kind regards
Dominik