nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Requesting for help running AB3 on CLI #119

Closed itstrueitstrueitsrealitsreal closed 9 months ago

itstrueitstrueitsrealitsreal commented 9 months ago

I'm having trouble running AB3 on my machine:

Specs: M1 Pro Macbook running on MacOS Sonoma 14.2.1 Java Version:

[~/Desktop/CS2103/AB3]$ java --version
java 19.0.1 2022-10-18
Java(TM) SE Runtime Environment (build 19.0.1+10-21)
Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)

Replicating the issue: I downloaded AB3 from the site and followed the guide till step 4, ran the command java -jar addressbook.jar and got this error log:

[~/Desktop/CS2103/AB3]$ java -jar addressbook.jar
Jan 29, 2024 2:24:47 PM seedu.address.Main main
WARNING: The warning about Unsupported JavaFX configuration below can be ignored.
Jan 29, 2024 2:24:47 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6ced7109'
Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/kennethseet/.openjfx/cache/17.0.7/libprism_es2.dylib
java.lang.UnsatisfiedLinkError: Can't load library: /Users/kennethseet/.openjfx/cache/17.0.7/libprism_es2.dylib
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2408)
    at java.base/java.lang.Runtime.load0(Runtime.java:785)
    at java.base/java.lang.System.load(System.java:2011)
    at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
    at com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:63)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at 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:390)
    at java.base/java.lang.Class.forName(Class.java:381)
    at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.base/java.lang.Thread.run(Thread.java:1589)
Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/kennethseet/.openjfx/cache/17.0.7/libprism_sw.dylib
java.lang.UnsatisfiedLinkError: Can't load library: /Users/kennethseet/.openjfx/cache/17.0.7/libprism_sw.dylib
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2408)
    at java.base/java.lang.Runtime.load0(Runtime.java:785)
    at java.base/java.lang.System.load(System.java:2011)
    at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
    at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:43)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at 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:390)
    at java.base/java.lang.Class.forName(Class.java:381)
    at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.base/java.lang.Thread.run(Thread.java:1589)
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:283)
    at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
    at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:278)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
    at java.base/java.lang.Thread.run(Thread.java:1589)

Thanks in advance!

Jerome-j commented 9 months ago

Hello @itstrueitstrueitsrealitsreal, please follow the exact version that the course website specified. I encountered the same error previously. I downloaded this zulu11.50.19-ca-fx-jdk11.0.12-macosx_aarch64.dmg from the https://nus-cs2103-ay2324s2.github.io/website/admin/programmingLanguages.html#programming-language guide here and it works well :)

I am using a M2 Pro Macbook Pro too

itstrueitstrueitsrealitsreal commented 9 months ago

Thanks @Jerome-j it worked beautifully after I installed the sdk using sdkman, didn't really pay attention when reading that section for the first time. Closing this issue!