gluonhq / gluonfx-maven-plugin

Plugin that simplifies creating native images for Java/JavaFX maven projects
BSD 3-Clause "New" or "Revised" License
189 stars 39 forks source link

IllegalAccessError: class GluonFeature (in unnamed module #470

Open Blacktoviche opened 1 year ago

Blacktoviche commented 1 year ago

I'm trying to build a simple JavaFX app. I have tried gluonfx-maven-plugin latest version with graalvm-ce-java17-22 and javafx-sdk-17.0.6 and got this error Operating System is Ubuntu 22.04. javafx-sdk-17.0.6 graalvm-ce-java17-22 openJdk 17.0.6+10

`[Sun Apr 30 18:02:59 MSK 2023][INFO] ==================== COMPILE TASK ====================


        |       ||   |    |  | |  ||       ||  |  | |
        |    ___||   |    |  | |  ||   _   ||   |_| |
        |   | __ |   |    |  |_|  ||  | |  ||       |
        |   ||  ||   |___ |       ||  |_|  ||  _    |
        |   |_| ||       ||       ||       || | |   |
        |_______||_______||_______||_______||_|  |__|

Access to the latest docs, tips and tricks and more info on
how to get support? Register your usage of Gluon Substrate now at

https://gluonhq.com/activate

[Sun Apr 30 18:03:01 MSK 2023][INFO] We will now compile your code for x86_64-linux-linux. This may take some time. [Sun Apr 30 18:03:02 MSK 2023][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server. [Sun Apr 30 18:03:04 MSK 2023][INFO] [SUB] ======================================================================================================================== [Sun Apr 30 18:03:04 MSK 2023][INFO] [SUB] GraalVM Native Image: Generating 'com.example.demo1.helloapplication' (shared library)... [Sun Apr 30 18:03:04 MSK 2023][INFO] [SUB] ======================================================================================================================== [Sun Apr 30 18:03:05 MSK 2023][INFO] [SUB] [GluonFeature] enabled for config com.oracle.svm.hosted.FeatureImpl$IsInConfigurationAccessImpl@473b3b7a [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] GluonFeature enabled in setup com.oracle.svm.hosted.FeatureImpl$DuringSetupAccessImpl@75fc1992 [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] [1/7] Initializing... (0.0s @ 0.13GB) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] Fatal error: java.lang.IllegalAccessError: class com.gluonhq.substrate.feature.GluonFeature (in unnamed module @0x5fac521d) cannot access class com.oracle.svm.core.jdk.NativeLibrarySupport (in module org.graalvm.nativeimage.builder) because module org.graalvm.nativeimage.builder does not export com.oracle.svm.core.jdk to unnamed module @0x5fac521d [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at com.gluonhq.substrate.feature.GluonFeature.duringSetup(GluonFeature.java:58) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$setupNativeImage$16(NativeImageGenerator.java:918) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:85) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:918) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:575) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:535) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:580) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128) [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------ [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] 0.2s (4.3% of total time) in 9 GCs | Peak RSS: 0.82GB | CPU load: 3.97 [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] ======================================================================================================================== [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] Failed generating 'com.example.demo1.helloapplication' after 4.0s. [Sun Apr 30 18:03:06 MSK 2023][INFO] [SUB] Error: Image build request failed with exit status 1 [Sun Apr 30 18:03:06 MSK 2023][SEVERE] Process compile failed with result: 1`

any idea how to fix it? I have tried using gluonfx-maven-plugin from 1.0.11 to 1.0.18 it's the same error.

GZYangKui commented 11 months ago

+1