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

Set JDK target and source #41

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

mroth
Copy link
Contributor

@mroth mroth commented Jun 19, 2019

This should help prevent most gotchas based on local developer environment, but isn't foolproof, see note below I found:

Note: Merely setting the target option does not guarantee that your code actually runs on a JRE with the specified version. The pitfall is unintended usage of APIs that only exist in later JREs which would make your code fail at runtime with a linkage error. To avoid this issue, you can either configure the compiler's boot classpath to match the target JRE or use the Animal Sniffer Maven Plugin to verify your code doesn't use unintended APIs. In the same way, setting the source option does not guarantee that your code actually compiles on a JDK with the specified version. To compile your code with a specific JDK version, different than the one used to launch Maven, refer to the Compile Using A Different JDK example.

https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Copy link
Owner

@adridadou adridadou left a comment

Choose a reason for hiding this comment

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

in line 262,
I think that this plugin does it already

org.apache.maven.plugins maven-compiler-plugin 3.8.0 1.8 1.8

@mroth
Copy link
Contributor Author

mroth commented Jun 19, 2019

Huh, that's certainly possible! 🤷‍♂

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.

2 participants