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

Maven building the JAR fails: Fatal error compiling: invalid flag: --release #6

Closed
bogdankatishev opened this issue Jul 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bogdankatishev
Copy link
Contributor

Hello,

I noticed something strange in the pom.xml file:

<maven.compiler.release>8</maven.compiler.release>

This line (release tag) introduces a feature that is only available from java 9 and +.
But this project is targeted to be build with java 8.
Hence getting the error: (when executing mvn clean package)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project nexus-repository-services: Fatal error compiling: invalid flag: --release -> [Help 1]

Also tried building it with openjdk 11 but I am getting this clear error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project nexus-repository-services: Fatal error compiling: error: release version 8 not supported -> [Help 1]

Removing this line from the pom.xml file fixes the building on java 8:

<maven.compiler.release>8</maven.compiler.release>

@a-langer
Copy link
Owner

Thanks, approved.

@a-langer a-langer added the bug Something isn't working label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants