Skip to content

build(Application): upgrade Java version from 17 to 21 - #378

Open
hirokiterashima wants to merge 1 commit into
developfrom
build/java-21
Open

hirokiterashima wants to merge 1 commit into
developfrom
build/java-21

Conversation

@hirokiterashima

@hirokiterashima hirokiterashima commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Upgrade from Java 17 to Java 21

Changes

  • pom.xml: set java.version to 21 (it was inherited as 17 from the Spring Boot parent)
  • Dockerfile: build and runtime images use eclipse-temurin-21 / eclipse-temurin:21
  • Dockerfile.dev: uses eclipse-temurin-21
  • .github/workflows/ci.yml, release.yml: set up JDK 21
  • scripts/beforeInstall.sh: installs openjdk-21-jdk-headless. EC2 hosts must run Ubuntu 22.04 or newer
  • .classpath, .settings/org.eclipse.jdt.core.prefs: Eclipse/STS settings set to Java 21

The application code itself does not change.

How to verify

  1. Point your dev environment at the Java 21 image. In WISE-Docker-Dev/docker-compose.yml, change the wise-api service's image:
    image: wiseberkeley/wise-api-dev:java-21
  2. Pull the image and recreate the container:
    docker compose pull wise-api
    docker compose up -d wise-api
    Use up -d here, not docker compose restart. restart keeps using the old image.
  3. Check that it's on Java 21: docker compose exec wise-api java -version should show 21. The logs (docker compose logs -f wise-api) should show no errors at startup.
  4. Smoke test: log in as a teacher and as a student, open a run, and save some student work. Everything should work as it does on develop.
  5. Tests (optional, local): ./mvnw clean verify should pass, the same as on develop.
  6. CI: the ci.yml checks pass on this PR.

When you're done reviewing, change image: back to the previous value and run step 2 again.

⚠️ Troubleshooting

If you build or run WISE-API outside Docker, you need JDK 21. If you see release version 21 not supported (or other strange build errors), Maven or your IDE is still using JDK 17.

  • Check with mvn -v and /usr/libexec/java_home -V
  • Install: brew install --cask temurin@21
  • Switch: export JAVA_HOME=$(/usr/libexec/java_home -v 21)
  • In your IDE, set the project JDK to 21 (Eclipse/STS: Installed JREs and Java Build Path)

If WISE-API container fails to start, you might be using application.properties that are intended for spring-boot-3.5 PR. This is only applicable for those who have reviewed the SpringBoot 3.5 PR. Check the stacktrace error message for clues and make sure that you have the right key names.

PR clean up

  • Remember to remove java-21 image from DockerHub before merge

Remove unused .travis.yml
@hirokiterashima hirokiterashima self-assigned this Dec 3, 2026
@hirokiterashima hirokiterashima added the enhancement New feature or request label Dec 3, 2026
@hirokiterashima
hirokiterashima marked this pull request as ready for review December 3, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant