如何使JRE,编译器和建立Maven项目的路径在Eclipse中兼容

发布于 2025-02-13 23:37:42 字数 1058 浏览 0 评论 0原文

我有一个Maven项目,我需要在POM文件中设置以下内容:

<properties>
    <camunda.external-task-client.version>7.17.0</camunda.external-task-client.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

我的Java的版本是11:

openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)

我在Eclipse中遇到了两个警告:

  1. 编译器合规性指定为1.8,但使用了JRE 11编译器合规性JRE编译器合规性问题

  2. 构建路径指定执行环境Javase-1.8。工作空间中没有安装JRE,与此环境严格兼容。

我搜索并发现我应该从“ Windows - &gt; preverences - &gt; java”中更改“编译器合规级”,然后我更改了如下。

但是,警告仍然存在。

任何人都可以帮助我。我在Java和Maven的经验较低。

I have a Maven project in which I need to set the following in POM file:

<properties>
    <camunda.external-task-client.version>7.17.0</camunda.external-task-client.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

The version of my Java is 11:

openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)

I encountered two warnings in eclipse:

  1. The compiler compliance specified is 1.8 but a JRE 11 is used Compiler Compliance JRE Compiler Compliance Problem.

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

I searched and found out that I should change "compiler compliance level" from "windows -> preferences -> java", and I changed it to 1.8, as following.

enter image description here

However, the warning still remains.

Could anyone please help me regarding this. I have low experience in Java and Maven.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文