Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build against Java 21 #2929

Merged
merged 13 commits into from
Jan 7, 2025
Merged

Build against Java 21 #2929

merged 13 commits into from
Jan 7, 2025

Conversation

sstone
Copy link
Member

@sstone sstone commented Oct 14, 2024

These are small, non-functional changes that are needed to target Java 21. The only real issue was the kanela agent, the version we used is not compatible with JDK21.
Eclair will require a Java runtime that is compatible with Java 21 and will no longer run on JRE 11 or JRE 17: DO NOT MERGE this PR until production environments have been updated with a Java 21 compatible JRE !!

@sstone sstone changed the title Changes needed to be compatible with JDK21 Changes needed to be compatible with a Java 21 runtime Oct 15, 2024
@sstone sstone changed the title Changes needed to be compatible with a Java 21 runtime Build against Java 21 Oct 21, 2024
Previous version was not compatible with JDK21, see kamon-io/kanela#150.
This will make it easier to control which version of maven is used to build eclair, which in turns makes deterministic builds easier, as well as
using recent compiler options (to target newer JDKs for example).
For example, even recent versions of Github runner images use an old verion of maven and there is no easy way to upgrade.
We now use multiarch (amd64/arm64) base images.
Eclair now targets Java 21 and will require a compatible Java Runtime Environment.
It will no longer work on JRE 11 and JRE 17.
@sstone sstone marked this pull request as ready for review December 12, 2024 09:26
@sstone
Copy link
Member Author

sstone commented Dec 12, 2024

Our test and production images have been updated and this PR is now safe to merge.

@sstone sstone requested a review from t-bast December 12, 2024 09:51
t-bast
t-bast previously approved these changes Dec 12, 2024
@sstone sstone requested a review from pm47 December 12, 2024 13:43
@t-bast t-bast mentioned this pull request Dec 26, 2024
t-bast
t-bast previously approved these changes Jan 7, 2025
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think this can be merged, will deploy ASAP to endurance.

@sstone sstone merged commit a35a972 into master Jan 7, 2025
1 check passed
@sstone sstone deleted the prepare-jdk21 branch January 7, 2025 14:56
@pm47
Copy link
Member

pm47 commented Jan 9, 2025

On Windows building requires adding:

<properties>
...
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
<properties>

Otherwise I get:

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ eclair-core_2.13 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\PM\git\eclair\eclair-core\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 8 or later.
[ERROR] Target option 5 is no longer supported. Use 8 or later.
[INFO] 2 errors

@sstone
Copy link
Member Author

sstone commented Jan 9, 2025

I tested this PR on windows (11) and macos without issues. Are you using the maven wrapper (mvnw.bat) or a local maven install ? are you using WSL ?

@pm47
Copy link
Member

pm47 commented Jan 9, 2025

I was using my locally installed maven. Indeed it does work with mvnw.

@remyers
Copy link
Contributor

remyers commented Jan 13, 2025

I see the same "source option 5..." error and needed to add those lines to pom.xml t fix it. I'm using Ubuntu 22.04.5 LTS and Temurin-21.0.5+11 when I do mvn clean isntall with master ef1a029.

@sstone
Copy link
Member Author

sstone commented Jan 13, 2025

I see the same "source option 5..." error and needed to add those lines to pom.xml t fix it. I'm using Ubuntu 22.04.5 LTS and Temurin-21.0.5+11 when I do mvn clean isntall with master ef1a029.

We've also switched to using the maven wrapper (./mvnw, similar to ./gradlew), have you tried ./mvnw clean install instead ?

@remyers
Copy link
Contributor

remyers commented Jan 13, 2025

Thanks - that fixed it. I thought I needed to install mvnw, but I was just missing the ./ in front of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants