Ares
Ares

Reputation: 111

Fatal error compiling: invalid flag: --release java 8

I am trying to execute maven command mvn clean install on my project, given that : maven is configured with jdk8.

I have the following error:

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

in my pom.xml I have the following plugin:

        <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.3.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Embed-Dependency>*;scope=compile</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>

                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>


                        <Import-Package>
                            *;resolution:=optional
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>

I tried removing tag :

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

and putting in place :

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

but I have this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project projectName: Execution default-testCompil e of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile failed: For input string: "" -> [Help 1]

And when i remove the tag :

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

i have the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project projectName: Fatal error compiling: invalid targe t release: 1.1.8 -> [Help 1]

Upvotes: 3

Views: 3072

Answers (0)

Related Questions