英文:
Installed Eclipse 2020-06, but didn't get Maven Project under File->New Section
问题
我已经安装了Eclipse 2020-06,但在“文件”->“新建”下找不到“Maven项目”选项。所以我尝试从“文件”->“新建”->“项目”创建一个Maven项目。
然后我得到了2个警告:
-
构建路径指定了执行环境J2SE-1.5。工作空间中没有与此环境严格兼容的JRE已安装。新项目构建路径JRE系统库问题。
-
指定的编译器兼容性为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:
-
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 -
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.
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
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
to your pom.xml
.
See also:
https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论