Add new comment

Error with AdoptOpenJDK 11

Hello,

We have a problem with Jar2exe version 2.5 and AdoptOpenJDK version 11. We have a GUI application and a service application, both compiled with "jre_order bcesi".

Our GUI application encounters an exception when using a bundled JRE (in "jre" subdirectory) and is trying to read fonts. The fonts and application are in the same jar. If we put the JRE in different directory and use configuration file and jvmdll parameter, the program works (but the service application does not work, read below). With jar2exe version 2.2 and JRE 1.8 the bundled JRE worked. Here's the stacktrace:

210114:064633.808 Error loading resource font:/com/xxxxx/resources/fonts/RobotoMono-Regular.ttf
*** BEGIN EXCEPTION (java.io.IOException: Problem reading font data.) ***
java.io.IOException: Problem reading font data.
at java.desktop/java.awt.Font.createFont0(Font.java:1183)
at java.desktop/java.awt.Font.createFont(Font.java:1052)

...

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at com.regexlab.j2e.Jar2ExeLauncher.main(Jar2ExeLauncher.java:48)
*** END EXCEPTION ***

Our service application only works with bundled JRE, but not with jvmdll parameter.