project compile error release 8需要发布目标1.8

时间:2022-01-14 17:05:18

I have an error Error:java: javacTask: source release 8 requires target release 1.8. I use 1.8 java, language level set to 8. The only thing I guess could be the reason is the line in the pom.xml file

我有一个错误错误:java:javacTask:source release 8需要目标版本1.8。我使用1.8 java,语言级别设置为8.我猜唯一可能的原因是pom.xml文件中的行

         <configuration>
               <executable>${java.home}/bin/java</executable>
               <commandlineArgs>${runfx.args}</commandlineArgs>
         </configuration>

here the line

在这里

 <commandlineArgs>${runfx.args}</commandlineArgs>

is red and what to do with this I can't manage to get.

是红色的,如何处理这个我无法得到。

1 个解决方案

#1


To set the compiler version in Maven, you would have something that looks like this in your pom.xml file:

要在Maven中设置编译器版本,您的pom.xml文件中会有类似的内容:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

3.3 is the latest Maven Compiler Plugin version. I assumed it was needed for Java 8 support.

3.3是最新的Maven编译器插件版本。我认为它是Java 8支持所必需的。

This is the same as setting the -source and -target compiler options.

这与设置-source和-target编译器选项相同。

#1


To set the compiler version in Maven, you would have something that looks like this in your pom.xml file:

要在Maven中设置编译器版本,您的pom.xml文件中会有类似的内容:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

3.3 is the latest Maven Compiler Plugin version. I assumed it was needed for Java 8 support.

3.3是最新的Maven编译器插件版本。我认为它是Java 8支持所必需的。

This is the same as setting the -source and -target compiler options.

这与设置-source和-target编译器选项相同。