安装了Eclipse 2020-06,但在”文件”->”新建”部分没有看到Maven项目。

huangapple go评论80阅读模式
英文:

Installed Eclipse 2020-06, but didn't get Maven Project under File->New Section

问题

我已经安装了Eclipse 2020-06,但在“文件”->“新建”下找不到“Maven项目”选项。所以我尝试从“文件”->“新建”->“项目”创建一个Maven项目。

然后我得到了2个警告:

  1. 构建路径指定了执行环境J2SE-1.5。工作空间中没有与此环境严格兼容的JRE已安装。新项目构建路径JRE系统库问题。

  2. 指定的编译器兼容性为1.5,但使用了JRE 1.8。新项目编译器兼容性JRE编译器兼容性问题。

pom.xml的内容已作为图像附加。它不包含构建、属性或依赖块,但它应该包含。

我在Windows 7上安装了JDK 1.8和JRE 1.8。

如何解决这个问题?我应该安装其他版本的Eclipse吗?

英文:

I have installed Eclipe 2020-06 but couldn't find Maven Project option under File->New. So I tried creating a Maven Project from File->New->Project.

Then I got 2 warnings:

  1. Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace
    that are strictly compatible with this environment.new-project Build path JRE System
    Library Problem

  2. The compiler compliance specified is 1.5 but a JRE 1.8 is used new-project Compiler
    Compliance JRE Compiler Compliance Problem

The content of pom.xml is attached as an image. It doesn't contain build or properties or dependencies blocks, which it should have contained.

安装了Eclipse 2020-06,但在”文件”->”新建”部分没有看到Maven项目。

I have JDK 1.8 and JRE 1.8 in Windows 7.

How to fix the problem? Should I install some other versions of Eclipse?

答案1

得分: 1

你的Eclipse没有问题。

你只需要在你的pom.xml中添加以下内容:

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

另请参考:

https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

英文:

There is nothing wrong with your Eclipse.

You just need to add

  &lt;properties&gt;
    &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
    &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;

to your pom.xml.

See also:

https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

huangapple
  • 本文由 发表于 2020年7月22日 00:57:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/63019372.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定