Problem running JavaFX in maven plugins

Dan Armbrust daniel.armbrust.list at
Tue Jan 1 03:54:14 UTC 2019


I'm trying to migrate a codebase to JDK 11 / OpenJFX, and have run into an issue I didn't 
have under JDK 8.

We have a complex maven build process - parts of which include building our own maven 
plugins, and then executing those plugins in a different portion of the build.

Maven uses isolated Plugin Classloaders for each plugin execution:

When my plugin executes, its going down a path that needs to start up the JavaFX subsystem 
- mostly to get support for tasks and such (we are actually building headless, with a hack 
of a HeadlessToolkit shimmed in to make JavaFX actually work headless) but - it would 
appear that because some other class loader in my build process already hit the JavaFX 
startup once... I fail on a native library load:

Loading library glass from resource failed: java.lang.UnsatisfiedLinkError: Native Library 
/home/darmbrust/.openjfx/cache/11/ already loaded in another classloader
java.lang.UnsatisfiedLinkError: Native Library 
/home/darmbrust/.openjfx/cache/11/ already loaded in another classloader
         at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(
         at java.base/java.lang.ClassLoader.loadLibrary0(
         at java.base/java.lang.ClassLoader.loadLibrary(
         at java.base/java.lang.Runtime.load0(
         at java.base/java.lang.System.load(
         at java.base/ Method)
         at com.sun.javafx.application.PlatformImpl.startup(

Any suggestions on how to deal with this?

I'm running on linux with:
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

I'm going to try this hack and see if it works:

But it would be nice to have a proper solution for this.

Also, on a completely unrelated note, where the heck is the JavaFX bug tracker these 
days?  There seems to be no end to confusing information out there about where the bug 
tracker is, multiple github mirrors have trackers, and the place that should clarify this 
says nothing:

Multiple Oracle pages still point to the Jira, many other pages point to the, others point to but that shows no 
javafx project.

Is this one official now?


More information about the openjfx-dev mailing list