问题描述
我正在使用Eclipse 4.3.2和,随着m2e和Subclipse,完全更新到最新版本的所有东西。
我进入了Maven POM的项目,并将maven-compiler-plugin更改为: / p>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.5.1< / version>
< configuration>
< source> 1.8< / source>
< target> 1.8< / target>
我更新了我所有的Maven项目,试图做一个完整的清理和构建。错误遍布整个地方。忽略内部编译器错误的时刻,我最看到的错误是:
语法错误,静态导入仅在源级别为1.5或更高
我正在运行Java 1.8 ---为什么我收到此消息?是m2e责怪吗maven-compiler-plugin?或者Eclipse Java 1.8支持根本没有准备好黄金时段?
显然m2e还不支持Java 8。 p>
根据Eclipse ,您必须从软件站点。我做到了这一点,源级别1.5的错误消失了。
I'm using Eclipse 4.3.2 with the patches for Java 8 from, along with m2e and Subclipse, completely updated to the latest versions of everything.
I went into the Maven POMs for our project and changed the maven-compiler-plugin to:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
I updated all my Maven projects tried to do a complete clean and build. Errors all over the place. Ignoring the internal compiler error for the moment, the error I see most is:
Syntax error, static imports are only available if source level is 1.5 or greater
I'm running Java 1.8---why am I getting this message? Is m2e to blame? The maven-compiler-plugin? Or is Eclipse Java 1.8 support simply not ready for prime time?
Apparently m2e doesn't yet support Java 8.
According to Eclipse Bug 420848, you have to install m2e 1.5 M6 from the http://download.eclipse.org/technology/m2e/milestones/1.5 software site. I did this and the source level 1.5 errors went away.
这篇关于Eclipse 4.3.2与Java 8补丁不能识别源级1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!