gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 22 forks source link

GraalVM for JDK 20 Community 20.0.2 #178

Closed Hugolarson closed 1 year ago

Hugolarson commented 1 year ago

Hi,

https://github.com/graalvm/graalvm-ce-builds/releases/tag/jdk-20.0.2

Im getting error with this version of graal (latest).

javafx { version = '17.0.8' modules = [ 'javafx.base', 'javafx.graphics', 'javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.web' ] }

Process

compile

Command Line

C:\java\graalvm-community-openjdk-20.0.2+9.1\bin\native-image.cmd "-Djdk.internal.lambda.eagerlyInitialize=false" --no-server -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout "-H:DeadlockWatchdogInterval=0" -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite "--features=org.graalvm.home.HomeFinderFeature" "-H:TempDirectory=C:\projekt\HelloFX\build\gluonfx\x86_64-windows\gvm\tmp" "-H:EnableURLProtocols=http,https" "-H:ReflectionConfigurationFiles=C:\projekt\HelloFX\build\gluonfx\x86_64-windows\gvm\reflectionconfig-x86_64-windows.json" "-H:JNIConfigurationFiles=C:\projekt\HelloFX\build\gluonfx\x86_64-windows\gvm\jniconfig-x86_64-windows.json" "-H:ResourceConfigurationFiles=C:\projekt\HelloFX\build\gluonfx\x86_64-windows\gvm\resourceconfig-x86_64-windows.json" "-H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.media.jfxmedia.MediaErrors,com.sun.javafx.tk.quantum.QuantumMessagesBundle,com/sun/glass/ui/win/themes" "-Dsvm.platform=org.graalvm.nativeimage.Platform$WINDOWS_AMD64" -cp "C:\java\gradle\caches\jars-9\9a0ab35f17e0851c93d25ff65b28f8fb\substrate-0.0.59.jar;C:\projekt\HelloFX\build\gluonfx\x86_64-windows\gvm\tmp\classpathJar.jar" hellofx.HelloFX

Output

Warning: Ignoring server-mode native-image argument --no-server.

GraalVM Native Image: Generating 'hellofx.hellofx' (shared library)...

For detailed information and explanations on the build output, visit: https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md

Warning: Could not resolve class java.net.AbstractPlainSocketImpl for reflection configuration. Reason: java.lang.ClassNotFoundException: java.net.AbstractPlainSocketImpl. Warning: Field java.net.InetAddress.preferIPv6Address not found. Warning: Field java.net.NetworkInterface.defaultIndex not found. Warning: Method javafx.scene.layout.BorderPane.getAlignment(Parent) not found. Warning: Method javafx.scene.layout.BorderPane.getAlignment(AnchorPane) not found. Warning: Method javafx.scene.layout.BorderPane.getAlignment(Pane) not found. Warning: Method javafx.scene.layout.BorderPane.getAlignment(Region) not found. Warning: Method javafx.scene.layout.BorderPane.getAlignment(VBox) not found. Warning: Method javafx.scene.layout.BorderPane.isAlignment(Parent) not found. Warning: Method javafx.scene.layout.BorderPane.isAlignment(AnchorPane) not found. Warning: Method javafx.scene.layout.BorderPane.isAlignment(Pane) not found. Warning: Method javafx.scene.layout.BorderPane.isAlignment(Region) not found. Warning: Method javafx.scene.layout.BorderPane.isAlignment(VBox) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Object, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Styleable, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(EventTarget, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Node, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Parent, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Parent, Pos) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(AnchorPane, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(AnchorPane, Pos) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Pane, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Pane, Pos) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Region, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(Region, Pos) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(VBox, String) not found. Warning: Method javafx.scene.layout.BorderPane.setAlignment(VBox, Pos) not found. Warning: Could not resolve class javafx.scene.web.WebView for reflection configuration. Reason: java.lang.ClassNotFoundException: javafx.scene.web.WebView. [1/8] Initializing... (5,4s @ 0,23GB) Java version: 20.0.2+9, vendor version: GraalVM CE 20.0.2+9.1 Graal compiler: optimization level: 2, target machine: x86-64-v3 C compiler: cl.exe (microsoft, x64, 19.36.32535) Garbage collector: Serial GC (max heap size: 80% of RAM) 1 user-specific feature(s)

Error: Resource pattern "javafx.graphics:\Qglass.dll\E"s specifies unknown module javafx.graphics com.oracle.svm.core.util.UserError$UserException: Resource pattern "javafx.graphics:\Qglass.dll\E"s specifies unknown module javafx.graphics at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:73) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ResourcesFeature.makeResourcePattern(ResourcesFeature.java:368) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.concurrent.ConcurrentHashMap$KeySpliterator.forEachRemaining(ConcurrentHashMap.java:3573) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ResourcesFeature.compilePatterns(ResourcesFeature.java:354) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ResourcesFeature.duringAnalysis(ResourcesFeature.java:337) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:770) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:86) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$11(NativeImageGenerator.java:770) at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.AbstractAnalysisEngine.runAnalysis(AbstractAnalysisEngine.java:179) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:767) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:582) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:539) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:408) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:612) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:134) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)

                   3,0s (11,3% of total time) in 43 GCs | Peak RSS: 2,41GB | CPU load: 11,22

======================================================================================================================== Finished generating 'hellofx.hellofx' in 26,0s.

Result

result: 1

Hugolarson commented 1 year ago

Problem was with the native-image *config.json. Running the agent again with the new version of graal fixed the issue. Seens that format of json changed.