猿问

使用Eclipse Photon和Maven的Java 10执行环境

我有一个使用Java 10的Maven项目,我想在Eclipse光子中对其进行编辑。它或多或少都可以,但是我确实得到了警告:


Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.

设置java compiler- >JDK compliance level到10在Eclipse项目属性不会删除此警告。


这是maven-compiler-plugin的问题吗?我当前正在使用3.7.0版进行配置,如下所示:


<plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-compiler-plugin</artifactId>

    <configuration>

        <source>10</source>

        <target>10</target>

        <release>10</release>

        <encoding>UTF-8</encoding>

    </configuration>

    <dependencies>

        <dependency>

            <groupId>org.ow2.asm</groupId>

            <artifactId>asm</artifactId>

            <version>6.2</version> <!-- Use newer version of ASM -->

        </dependency>

    </dependencies>

</plugin>

我们将不胜感激有关如何使用Java 10和Eclipse光子配置Maven项目的提示。


忽然笑
浏览 187回答 2
2回答

犯罪嫌疑人X

问题似乎出在项目的构建路径上指定的JRE上。右键单击该项目,然后转到“属性”>“ Java构建路径”>“库”。在那里,编辑指定给JRE 10的JRE系统库。

慕少森

实际上,我的问题与我使用的Spring Tool Suite的版本有关。事实证明,我是使用更新站点而不是下载新版本来升级我的环境的。我使用的是Spring Tool Suite 4.7.3a而不是4.8.0。使用4.8.0解决了该问题。
随时随地看视频慕课网APP

相关分类

Java
我要回答