nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

Checking if environment is compatible using addressbook.jar on Mac #1

Open ZhuLeYao opened 1 year ago

ZhuLeYao commented 1 year ago

Mac terminal showed this in the first 4 lines.

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/leyaozhu/.openjfx/cache/11/libprism_es2.dylib java.lang.UnsatisfiedLinkError: Can't load library: /Users/leyaozhu/.openjfx/cache/11/libprism_es2.dylib

Does this mean my OS is incompatible?

damithc commented 1 year ago

@ZhuLeYao to confirm, are you following our instructions for Mac users given in https://nus-cs2103-ay2223s2.github.io/website/admin/programmingLanguages.html ?

ZhuLeYao commented 1 year ago

Yes, I have switched to the correct Java version.

(base) leyaozhu@Les-MacBook-Air Downloads % java -version java version "11.0.17" 2022-10-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.17+10-LTS-269) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.17+10-LTS-269, mixed mode)

As the instructions mentioned that the advisory is applicable only if unreadable, I am unsure if the failures also mean that the advisory is applicable to me.

damithc commented 1 year ago

Mac terminal showed this in the first 4 lines.

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/leyaozhu/.openjfx/cache/11/libprism_es2.dylib java.lang.UnsatisfiedLinkError: Can't load library: /Users/leyaozhu/.openjfx/cache/11/libprism_es2.dylib

The error happens when you run the addressbook.jar file?

ZhuLeYao commented 1 year ago

Yep, after I run it in terminal

(base) leyaozhu@Les-MacBook-Air Downloads % java -jar addressbook.jar

And I get the following for the first 4 lines

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/leyaozhu/.openjfx/cache/11/libprism_es2.dylib java.lang.UnsatisfiedLinkError: Can't load library: /Users/leyaozhu/.openjfx/cache/11/libprism_es2.dylib

damithc commented 1 year ago

I see. This issue is unlikely to affect you in the first few weeks. Let's wait to see if any other Mac users are facing similar problems.

ZhuLeYao commented 1 year ago

okay thank you!

Beebeeoii commented 1 year ago

i am running on M1 macOS 13.0.1 and it seems to work fine for me.

java -version
openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment Zulu11.60+19-CA (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.60+19-CA (build 11.0.17+8-LTS, mixed mode)

maybe can try other Java JDK builds like the one suggested in the webpage if the issue persists

hansstanley commented 1 year ago

JavaFX only added M1 support in version 17, might be an incompatibility issue for your 11.0.17.

The suggested Zulu 11 works for me on M1 macOS 13.1 though

BoAi01 commented 1 year ago

I am running on M1 macOS 13.0.1 and it looks fine as well.

openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment Zulu11.60+19-CA (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.60+19-CA (build 11.0.17+8-LTS, mixed mode)

However, mine is Zulu11.60, which is slightly different from the Zulu11.50 specified in our course website (attached below)

openjdk 11.0.__ ____-__-__ LTS
OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.__+_-LTS)
OpenJDK 64-Bit Server VM Zulu11.__+__-CA (build 11.0.__+_-LTS, mixed mode)

This should be a problem, I suppose?

damithc commented 1 year ago

However, mine is Zulu11.60, which is slightly different from the Zulu11.50 specified in our course website (attached below)

openjdk 11.0.__ ____-__-__ LTS
OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.__+_-LTS)
OpenJDK 64-Bit Server VM Zulu11.__+__-CA (build 11.0.__+_-LTS, mixed mode)

This should be a problem, I suppose?

@BoAi01 Yes, it should be fine.

angjunkang commented 1 year ago

I'm using the M1 Mac and encountered this issue earlier as well but solved it eventually.

(base) leyaozhu@Les-MacBook-Air Downloads % java -version java version "11.0.17" 2022-10-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.17+10-LTS-269) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.17+10-LTS-269, mixed mode)

I got a similar result doing checking the java version on the terminal and if you are seeing this, it is highly likely you have existing JDKs in your mac and have not uninstalled them. Follow the instructions given by the video that was provided to us to uninstall the other JDKs and ensure that you see Zulu11 after performing a java --version. This fix the problem for me.

Hope it helps anyone out there!

damithc commented 1 year ago

@ZhuLeYao Is the issue resolved? If so, you can close this issue. If no, post more details so that others can follow up.

lxz333 commented 1 year ago

I also met this problem and I'm using M2 Mac. The reason it didn't work for me at first was because beside the suggested Zulu11, I also have another OpenJdk11 installed in my mac. It was hidden in another path so I carelessly ignored that. Therefore I believe that uninstalling all the other jdk and only keeping the Zulu 11 will help!

nus-se-bot commented 1 year ago

@ZhuLeYao 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.

sikai00 commented 1 year ago

Hello @ZhuLeYao, I'm a senior from a previous batch, dropping by to look at the issues posted by you guys. Just a gentle reminder to close the issue if your problem has been resolved :)

Hikoya commented 1 year ago

Hello @ZhuLeYao, I'm a senior from a previous batch, another gentle reminder to close the issue if the problem has been resolved. Else, please provide more details so that other pupils can follow up!