nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

I can't run the addressbook.jar for my tp assignment #145

Open lancehaha opened 2 weeks ago

lancehaha commented 2 weeks ago

I can't run the addressbook.jar even though I do have java17, and I'm sure that I entered the correct directory by using cd, but running java -jar addressbook.jar show me some error with java.fx?

the os I'm using is the mac os version 14.6

(base) dd@ds-Laptop ab3home % java -version java version "17.0.12" 2024-07-16 LTS Java(TM) SE Runtime Environment Oracle GraalVM 17.0.12+8.1 (build 17.0.12+8-LTS-jvmci-23.0-b41) Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.12+8.1 (build 17.0.12+8-LTS-jvmci-23.0-b41, mixed mode, sharing)

(base) dd@ds-Laptop ~ % cd ab3home (base) dd@ds-Laptop ab3home % java -jar addressbook.jar Aug 31, 2024 12:04:31 AM seedu.address.Main main WARNING: The warning about Unsupported JavaFX configuration below (if any) can be ignored.

Aug 31, 2024 12:04:31 AM com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6a8a125f' Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib: dlopen(/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib, 0x0001): tried: '/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib' (no such file), '/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) java.lang.UnsatisfiedLinkError: /Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib: dlopen(/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib, 0x0001): tried: '/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib' (no such file), '/Users/dd/.openjfx/cache/17.0.7/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394) at java.base/java.lang.Runtime.load0(Runtime.java:755) at java.base/java.lang.System.load(System.java:1957) 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.(ES2Pipeline.java:52) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:375) 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:842) Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: /Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib: dlopen(/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib, 0x0001): tried: '/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib' (no such file), '/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) java.lang.UnsatisfiedLinkError: /Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib: dlopen(/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib, 0x0001): tried: '/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib' (no such file), '/Users/dd/.openjfx/cache/17.0.7/libprism_sw.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394) at java.base/java.lang.Runtime.load0(Runtime.java:755) at java.base/java.lang.System.load(System.java:1957) 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.(SWPipeline.java:42) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:375) 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:842) 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:842) 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:842)

damithc commented 2 weeks ago

@lancehaha While waiting for inputs from others, perhaps you can share the OS you are using, and the output for the java -version command?

lancehaha commented 2 weeks ago

@damithc mac os 14.6 (base) dd@ds-Laptop ab3home % java -version java version "17.0.12" 2024-07-16 LTS Java(TM) SE Runtime Environment Oracle GraalVM 17.0.12+8.1 (build 17.0.12+8-LTS-jvmci-23.0-b41) Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.12+8.1 (build 17.0.12+8-LTS-jvmci-23.0-b41, mixed mode, sharing)

TY1Fan commented 2 weeks ago

Hi having Java 17 is not enough. Have you installed the Java 17 JDK FX version (codename Zulu) using SDKMAN?

You can refer to this link for java setup for macos: https://se-education.org/guides/tutorials/javaInstallationMac.html

This is how my java version look like:

 java --version
openjdk 17.0.11 2024-04-16 LTS
OpenJDK Runtime Environment Zulu17.50+19-CA (build 17.0.11+9-LTS)
OpenJDK 64-Bit Server VM Zulu17.50+19-CA (build 17.0.11+9-LTS, mixed mode, sharing)
lancehaha commented 2 weeks ago

@TY1Fan thank you so much problem solved

TY1Fan commented 2 weeks ago

@lancehaha No worries :)

yadobler commented 2 weeks ago

@lancehaha dont forget to close this!

nus-se-bot commented 15 hours ago

@lancehaha A gentle reminder to close this issue if the problem has been resolved. If not resolved yet, please post a comment explaining which part of the problem/question remains unresolved.