I've been trying to download JavaFX for a project and my laptop is just not having it when I try to gradle run.
I can gradle build just fine but when I try gradle run I get this message:
> Configure project :
Project : => no module-info.java found
> Task :run FAILED
Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/claretian/.openjfx/cache/20+19/aarch64/libprism_es2.dylib: dlopen(/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_es2.dylib, 0x0001): tried: '/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
java.lang.UnsatisfiedLinkError: /Users/claretian/.openjfx/cache/20+19/aarch64/libprism_es2.dylib: dlopen(/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_es2.dylib, 0x0001): tried: '/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2404)
at java.base/java.lang.Runtime.load0(Runtime.java:817)
at java.base/java.lang.System.load(System.java:2015)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
at javafx.graphics@20/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:63)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at javafx.graphics@20/com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:52)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:391)
at java.base/java.lang.Class.forName(Class.java:382)
at javafx.graphics@20/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:1623)
Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: /Users/claretian/.openjfx/cache/20+19/aarch64/libprism_sw.dylib: dlopen(/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_sw.dylib, 0x0001): tried: '/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
java.lang.UnsatisfiedLinkError: /Users/claretian/.openjfx/cache/20+19/aarch64/libprism_sw.dylib: dlopen(/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_sw.dylib, 0x0001): tried: '/Users/claretian/.openjfx/cache/20+19/aarch64/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2404)
at java.base/java.lang.Runtime.load0(Runtime.java:817)
at java.base/java.lang.System.load(System.java:2015)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
at javafx.graphics@20/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
at javafx.graphics@20/com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:43)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at javafx.graphics@20/com.sun.prism.sw.SWPipeline.<clinit>(SWPipeline.java:42)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:391)
at java.base/java.lang.Class.forName(Class.java:382)
at javafx.graphics@20/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:1623)
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
at javafx.graphics@20/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:263)
at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1081)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:1623)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1081)
Caused by: java.lang.RuntimeException: No toolkit found
at javafx.graphics@20/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:275)
at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 2 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Users/claretian/.sdkman/candidates/java/20.0.2-amzn/bin/java'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
3 actionable tasks: 2 executed, 1 up-to-date
I'm pretty sure it's to do with the architecture being incompatible but I've tried to download every version of JavaFX I could find.