reugn / dev-tools

A collection of developer utilities in a single desktop application
Apache License 2.0
310 stars 32 forks source link

Error running on M1 Mac #32

Open bowbahdoe opened 2 days ago

bowbahdoe commented 2 days ago
➜  java -jar dev-tools-0.6.0-amd64.jar
Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib: dlopen(/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib, 0x0001): tried: '/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib' (no such file), '/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
java.lang.UnsatisfiedLinkError: /Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib: dlopen(/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib, 0x0001): tried: '/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib' (no such file), '/Users/emccue/.openjfx/cache/11.0.2/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
    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:2402)
    at java.base/java.lang.Runtime.load0(Runtime.java:852)
    at java.base/java.lang.System.load(System.java:2028)
    at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:205)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:185)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:157)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)
    at com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:68)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
    at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:50)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:462)
    at java.base/java.lang.Class.forName(Class.java:453)
    at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    at java.base/java.lang.Thread.run(Thread.java:1575)
Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: /Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib: dlopen(/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib, 0x0001): tried: '/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib' (no such file), '/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
java.lang.UnsatisfiedLinkError: /Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib: dlopen(/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib, 0x0001): tried: '/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib' (no such file), '/Users/emccue/.openjfx/cache/11.0.2/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
    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:2402)
    at java.base/java.lang.Runtime.load0(Runtime.java:852)
    at java.base/java.lang.System.load(System.java:2028)
    at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:205)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:185)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:157)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:52)
    at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
    at com.sun.prism.sw.SWPipeline.<clinit>(SWPipeline.java:41)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:462)
    at java.base/java.lang.Class.forName(Class.java:453)
    at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    at java.base/java.lang.Thread.run(Thread.java:1575)
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 com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
    at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:1575)

➜  java --version
openjdk 23 2024-09-17
OpenJDK Runtime Environment Corretto-23.0.0.37.1 (build 23+37-FR)
OpenJDK 64-Bit Server VM Corretto-23.0.0.37.1 (build 23+37-FR, mixed mode, sharing)
reugn commented 2 days ago

@bowbahdoe, the dev-tools-0.6.0-amd64.jar build targets x64 (amd64) architectures. JavaFX applications compile to platform-dependent bytecode, so this jar will not work on Apple M series processors which use ARM (aarch64) architecture. I will look into adding a cross-platform build option.

maxandersen commented 2 days ago

I couldn't get it to work on mac without bumping JavaFX and java target up to 21.

bowbahdoe commented 2 days ago

While you are at it: I mess with my local java version a ton. It would be great if this was a jpackaged thing I could just drag a .app around for

reugn commented 1 day ago

@maxandersen, the CI workflow uses Java 11 for packaging, and the jar runs on JRE 11. However, the Gluon Maven plugin requires Java 21 for the native application build.