Skip to content
Advertisement

JavaFX IllegalAccessError on running application

I have a JavaFx 14 application running on JDK 14. I created a jlink runtime version that has the only the required modules I need to run the application on both Mac and Wins 10.

I wanted to add a PreLoader to show users while the background processes finish.

I test primarily on Mac OS and then try it on Windows to verify that it still works.

After changing the start from Application.launch(TripsFxApplication.class, args) to LauncherImpl.launchApplication(TripsFxApplication.class, TripsPreloader.class, args), I started seeing this exception trace (scan down).

This is my bat file to run it:

JavaScript

Now the same application works fine on Mac OSX and I see my preloader there, but on Windows 10, I get this error. Is there some extra module that I am missing to add in the bat file above?

Exception trace

JavaScript

Advertisement

Answer

ok, I searched around and if you want to use a PreLoader in a JDK 9+ modular environment, then you have to do it this way

JavaScript
Application will look for the property holding the preloader and insert it correctly. This should be documented better but there you go.
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement