搞了个Maven工程在Eclipse上,刚开始说JDK版本不对,编译的时候老报错误,很容易搞明白,
本地JDK版本为1.7.0_79:
diamond operator is not supported in -source 1.5
[ERROR] (use -source 7 or higher to enable diamond operator)
 
加上以下语句即可:
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
这样以后,编译的过程中没有错误了,但是Eclipse的Maven工程上有个小红叉,看着让人心理不爽。上网上搜了一番,找到个解决方法:
右击工程->Maven->更新工程,更新一下就没有什么事了。还没搞清楚到底是什么原因。

相关文章:

  • 2022-12-23
  • 2021-09-10
  • 2021-04-07
  • 2021-12-19
  • 2021-10-28
  • 2022-12-23
  • 2021-06-06
  • 2022-03-03
猜你喜欢
  • 2021-07-22
  • 2021-06-11
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
相关资源
相似解决方案