IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符
2017-02-28 00:00
411 查看
IntelliJ Idea maven项目编译报错:
参考文章[http://blog.csdn.net/wave_1102/article/details/47671019]都不能解决问题。
原来在IntelliJ Idea 默认的jdk是1.5。以上的修改都不会起作用的。见【https://maven.apache.org/plugins/maven-compiler-plugin/】
在项目的pom文件中加以下内容:
官网上也有说明[https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html]
Information:Using javac 1.7.0_79 to compile java sources Information:java: javacTask: 源发行版 1.7 需要目标发行版 1.7 Information:java: Errors occurred while compiling module 'wsdlutils' Information:2016/4/13 16:42 - Compilation completed with 1 error and 0 warnings in 1s 805ms Error:java: Compilation failed: internal java compiler error
参考文章[http://blog.csdn.net/wave_1102/article/details/47671019]都不能解决问题。
原来在IntelliJ Idea 默认的jdk是1.5。以上的修改都不会起作用的。见【https://maven.apache.org/plugins/maven-compiler-plugin/】
Also note that at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with. If you want to change these defaults, you should set source and target as described in Setting the -source and -target of the Java Compiler.
在项目的pom文件中加以下内容:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build>
官网上也有说明[https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html]
<project> [...] <build> [...] <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <source>1.4</source> <target>1.4</target> </configuration> </plugin> </plugins> [...] </build> [...] </project>
相关文章推荐
- IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符
- [Idea]Idea报错:请使用 -source 7 或更高版本以启用 diamond 运算符
- IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符
- idea启动maven项目报:请使用 -source 7 或更高版本以启用 diamond 运算符
- java: -source 1.5 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- IDEA Error:(71, 35) 错误: -source 1.6 中不支持 diamond 运算符(请使用 -source 7 或更高版本以启
- Error:(54, 61) 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- idea编译出现Error:(5, 22) java: -source 1.5 中不支持 lambda 表达式 (请使用 -source 8 或更高版本以启用 lambda 表达式)
- 错误:-source 1.5 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- 1.5不支持diamond运算符,请使用source 7或更高版本以启用diamond运算符,怎么办?
- 关于Maven installed出现source 1.5 中不支持 diamond 运算符问题(请使用 -source 7 或更高版本以启用 diamond 运算符)
- -source 1.5 中不支持 diamond 运算符 [ERROR] (请使用 -source 7 或更高版本以启用 diamond 运算符)
- 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- 兔子--Error:(88, 35) 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- Maven报错:(请使用 -source 7 或更高版本以启用 diamond 运算符)
- 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- Error:(70, 41) 错误: -source 1.6 中不支持 diamond 运算符 (请使用 -source 7 或更高版本以启用 diamond 运算符)
- 运行开源项目,报错Error:(48, 37) 错误: -source 1.6 中不支持 diamond 运算符,请使用-source 7或者更高版本已启用diamond运算符