为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

忽然笑 2021-05-14 22:46:56
我有一个使用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项目的提示。
查看完整描述

2 回答

?
犯罪嫌疑人X

TA贡献2080条经验 获得超4个赞

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


查看完整回答
反对 回复 2021-05-26
?
慕少森

TA贡献2019条经验 获得超9个赞

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


查看完整回答
反对 回复 2021-05-26
  • 2 回答
  • 0 关注
  • 186 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信