IntelliJ Idea编译报错:
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 'xxx'
Information:15/8/14 下午11:08 - Compilation completed with 1 error and 0 warnings in 1s 913ms
Error:java: Compilation failed: internal java compiler error
参考了附录中的文章,作如下修改(Idea版本14.1.4):
File-->Other Settings-->Default Settings-->Compiler-->Java Compiler
在Per-module bytecode version下点击“+”,出现的Choose Module框中是空白,无法修改Target bytecode version.
选择项目,右击选择“Open Project Settings”-->Modules-->Language Level,改成6、7、Project Default都不起作用,折腾半天。
在Stackoverflow上偶然搜索到如下说明(http://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7):
I've hit this after just minor upgrade from IntelliJ IDEA 14 to v14.1. For me changing an edit of top/parent pom helped and then clicked re-import Maven (if it is not automatic).
But it maybe just enough to Right Click on module(s)/aggregated/parent module and Maven -> Reimport.
选中项目,右击选择Maven-->Reimport, 再次编译,问题解决。
-------------------------附录------------------------
http://loftor.com/archives/idea-javacTask.html
在idea中编译时发生如下的错误
Information : Using javac 1.7 . 0_75 to compile java sources
Information : java : javacTask : 源发行版 1.6 需要目标发行版 1.6
Information : java : Errors occurred while compiling module 'kulong'
Information : 15 / 3 / 26 13 : 22 - Compilation completed with 1 error and 0 warnings in 5s 771ms
Error : java : Compilation failed : internal java compiler error
解决办法
setting->Compiler->Java Compiler 设置相应Module的target byte code version的合适版本就行来。