nus-oss / AB3-J17

:ab::three: Address Book sample application (Level 3)
https://se-education.org/addressbook-level3
MIT License
0 stars 16 forks source link

[Project A][MacSilicon][Kenneth Seet] Upgrade to Java 17 #6

Closed itstrueitstrueitsrealitsreal closed 2 months ago

itstrueitstrueitsrealitsreal commented 2 months ago

Description

This pull request includes updates to the documentation and the gradle.yml file to reflect the migration of the project to Java 17. Additionally, various JDK distributions were tested for compatibility with our codebase.

Environment Setup

Issues Encountered

Running AB3 on ARM64 Systems:

As an M1 Mac user, I encountered compatibility issues with certain Java versions. Non-supported SDKs would lead to a java.lang.UnsatisfiedLinkError indicating an 'incompatible architecture'—my machine uses ARM64, but the application required X86-64.

To resolve this, it's necessary to install an ARM64 compatible SDK with JavaFX bundled. However, constantly switching between different SDKs for various needs can be cumbersome.

During CS2103 in AY23/24 Semester 2, I discovered SDKMAN!, a UNIX command-line tool that facilitates switching between Java SDK versions. This tool proved essential as I needed Java 17 for teaching CS2030 and Java 11 for CS2103.

For my system, only the JDK versions 17.0.11.fx-zulu and 17.0.11.fx-librca were compatible.

Suggestion for Future Iterations

Considering the growing popularity of ARM64 machines, documenting the use of SDKMAN! for managing and switching Java SDKs could be beneficial for future courses.

damithc commented 2 months ago

@itstrueitstrueitsrealitsreal Thanks for investigating the Mac ARM issue. BTW, shouldn't there be a change to build.gradle as well? Is it possible that you didn't change build.gradle, and therefore, used Java 11 to build the JAR?

itstrueitstrueitsrealitsreal commented 2 months ago

@damithc Thanks for pointing that out, it seems I missed that out. I have updated sourceCompatibility and targetCompatability in build.gradle to reflect this, and updated the download link to the jar file. I have also verified that I am still able to build the jar file without any additional issues.

itstrueitstrueitsrealitsreal commented 2 months ago

In addition, I'd like to demonstrate how to see the full list of Java SDKs that SDKMAN offers for download, for others that may not be familiar with its usage.

  1. After downloading SDKMAN, enter the command sdk install java followed by pressing tab and wait for the full list of Java SDKs to be displayed on screen. It may take a few seconds, but this is what the list should look like.

    Screenshot 2024-06-30 at 3 13 17 PM
  2. After selecting the desired version, press Enter and wait for the download and installation to complete. It may take around 3-5 minutes, depending on the strength of your connection. You can then choose to set it as the default version, or not.

  3. After that, if you wish to switch between versions, you can run the command sdk use followed by tab to see all the installed SDKs on your system, and choose the desired version.

  4. Similarly, if you wish to set one of the installed SDKs as a default, you can run the command sdk default followed by tab to see all the installed SDKs on your system, and choose the desired version.

For any other use cases, you can refer to SDKMAN's documentation or run the command sdk help to see a list of all the commands.

hjungwoo01 commented 2 months ago

Tested on Mac Silicon with JDK-FX 17.0.11.fx-zulu, and working.

Steps I followed:

  1. Downloaded the JAR file from the PR.
  2. Switched to JDK-FX 17.0.11.fx-zulu using SDKMAN.
  3. Ran the JAR file using java -jar MacSilicon-KennethSeet.jar.
  4. Performed a smoke test to check basic functionality.

Results: Everything is functioning as expected.

Screenshots:

Screenshot 2024-07-04 at 3 43 45 PM
jyue487 commented 2 months ago

Tested on Mac Silicon with JDK-FX 17.0.11.fx-zulu, and working.

Steps and results are identical to above.

teoks0199 commented 2 months ago

Tested on Windows 11, and working.

Steps I followed:

  1. Downloaded the JAR file from the PR.
  2. Ran the JAR file using java -jar MacSilicon-KennethSeet.jar.
  3. Performed a smoke test to check basic functionality.

image

bennyLCK commented 2 months ago

Smoke-tested on Windows 11 using Oracle OpenJDK version 17.0.10 on Windows Powershell Terminal in the same manner as @teoks0199 and ensured all functionalities were in place.

image

baskargopinath commented 2 months ago

Tested on Mac Silicon with JDK-FX 17.0.11.fx-zulu, and working.

Steps: Downloaded the JAR file from the PR. Switched to JDK-FX 17.0.11.fx-zulu Ran the JAR file using java -jar MacSilicon-KennethSeet.jar. Performed a smoke test to check basic functionality. Results: Everything is functioning as expected.

Screenshots:

image
aureliony commented 2 months ago

Tested on Ubuntu 22.04.4 LTS with zulu jdk 17.0.11. JAR is working fine.

Steps followed: Downloaded the JAR file from the release. Ran the JAR file using java -jar MacSilicon-KennethSeet.jar. Performed a smoke test to check basic functionality.

Results: Everything is functioning as expected.

Screenshot from 2024-07-06 19-32-52

gongg21 commented 2 months ago

Tested on MacSilicon with JDK-FX 17.0.11.fx-zulu, and working fine. Switched using SDKMAN, ensure it is 17.0.11.fx-zulu, note the .fx suffix. Add/Delete command tested, works. Help command tested, works. Ran JAR file using java -jar <filename>.

Screenshot 2024-07-07 at 5 24 11 PM
Carlintyj commented 2 months ago

Tested on Mac (Silicon) using JDK-FX 17.0.11.fx-zulu and working.

Downloaded the JAR release, ran the jar file using java -jar MacSilicon-KennethSeet.jar Performed smoke test to check functionality.

Screenshot 2024-07-07 at 6 59 12 PM
drustanyjt commented 2 months ago

Tested on Linux (Ubuntu 22.04) using OpenJDK 17.0.11. Working.

Steps taken:

  1. Downloaded release
  2. Ran jar file using java -jar MacSilicon-KennethSeet.jar
  3. Tested with basic commands

image

ryanozx commented 2 months ago

Tested on MacSilicon (Sonoma 14.5) using JDK 17.0.11.fx-zulu and working.

Steps taken:

  1. Downloaded release
  2. Ran jar file using java -jar MacSilicon-KennethSeet.jar
  3. Performed smoke test to check basic functionality
Screenshot 2024-07-07 at 11 13 28 PM
jedkohjk commented 2 months ago

Tested on Windows 11 and working.

Steps I followed:

  1. Downloaded the JAR file from the release.
  2. Ran java -jar MacSilicon-KennethSeet.jar.
  3. Tested some basic commands.

Screenshot

damithc commented 2 months ago

Closing, as the migration was done in https://github.com/nus-oss/AB3-J17/commit/fe805d8553bbc329644371a6e732a8317ea6686f