Java track now on Java 25

The Java test runner is now running on Java 25! This means you can now use the (non-preview) features of Java 25 in your solutions.

5 Likes

All tests fails (with Java 25) because gradle wrapper is outdated in tests.

Do we have workflow or some script to upgrade gradle in all exercises?

Would a simple shell loop work? If you can share what needs to be done in one exercise, I can replicate it to the rest.

I use for the concrete exercise this:

  1. chmod +x gradlew
  2. ./gradlew wrapper --gradle-version 9.2.1

It replaced gradle-wrapper.jar and gradle-wrapper.properties in wrapper

The version 9.2.1 defined in java-test-runner.

Need to update conceptual and practical.

If a student uses old version java then it works.
Tests fails if you use Java 25

I think you can just copy those two files to all the exercise directories.

Assuming you have bash or any POSIX shell,

cd java_repo
for path in exercises/concept/*/ exercises/practice/*/; do
    cp </path/to/the.jar> </path/to/the.properties> "${path}gradle/wrapper/
done
1 Like

I will be grateful if you help me resolve issue with deprecated exercises…

Sorry, just saw the latest posts. @rabestro, there are instructions for updating the gradle wrapper in reference/how-to-update-gradle.md (copied below).

To update the Gradle version of each Gradle wrapper in this repository, start by updating the Gradle wrapper in the exercises directory:

./gradlew wrapper --gradle-version=X.Y

Then, update the Gradle wrappers for each exercise to match the root version:

./gradlew allWrappers

Finally, commit and push your changes.

I’ll take a look at the PR in the meantime.

2 Likes

❌ Deprecated exercise changed: exercises/practice/minesweeper

You made changes to Minesweeper which is doesn’t like. You can reset those to a prior version, eg what you’ve got on the main branch:

git checkout main -- exercises/practice/minesweeper/gradlew.bat exercises/practice/minesweeper/gradlew
git add exercises/practice/minesweeper/gradlew.bat exercises/practice/minesweeper/gradlew
git commit -m 'Revert minesweeper files'
git push

Thanks! I have recreate pull request following the reference, please review:

3 Likes

Thanks @rabestro! I’ve just approved and merged it in.

2 Likes