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

Fix Java 8 compatibility issue #45

Merged

Conversation

amottier
Copy link
Contributor

  • Update the pom.xml to build a version compatible with Java 8 using AdoptopenJDK 11.
  • maven.compiler.release (javac option --release) is used instead of maven.compiler.source and maven.compiler.target (javac options -source and -target) to produce class files link against the appropriate platform version (see http://openjdk.java.net/jeps/247).

- Update the pom.xml to build a version compatible with Java 8 using AdoptopenJDK 11.
- `maven.compiler.release` (`javac` option `--release`) is used instead of `maven.compiler.source` and `maven.compiler.target` (`javac` options `-source` and `-target`) to produce class files link against the appropriate platform version (see http://openjdk.java.net/jeps/247).
@cesarsotovalero
Copy link
Collaborator

Hi @amottier.
I'm looking at this SO answer.
We want to be compatible with Java 8, but build with Java 11+ (taking care of API incompatibility changes at the same time).

It seems that the solution using a profile in the SO answer is a good approach.

@amottier
Copy link
Contributor Author

@cesarsotovalero as far as I understand the solution described in SO answer cover the need of being able to build both with JDK 8 and 9+.

If the need for depclean is to be compatible:

  • for execution with JDK 8 and higher
  • for compilation with JDK 9+ only (not compatible with JDK 8 or lower)

I think that the solution I suggest is sufficient.

Actually I tested my PR by building it with OpenJDK 11 and then using the depclean plugin with both OpenJDK 8 and 11 and it run flawlessly. So I'm quite confident that my solution fix the issue.

@cesarsotovalero
Copy link
Collaborator

@amottier I also tested the changes. It builds successfully with JDKs 8, 11, and 15.
I'm merging your PR.
Thanks for your contribution 👍

@cesarsotovalero cesarsotovalero merged commit 9d906d2 into ASSERT-KTH:master Mar 17, 2021
mtorres10 added a commit to mtorres10/depclean that referenced this pull request Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants