执行idea时出现"无效的源发行版"

如题所述

如果你安装的是JDK1.7,而在file->project structure中设置的是language level是8的话,就会出现这个错误提示:无效的源发行版:8。

解决办法:将语言级别改为7,或6。即语言级别不能高于你安装的版本。


另外,如果file -> settings -> build,exception,deployment -> compiler -> java compiler 中如果将模块的target bytecode version改为1.8,则会出现这个错误提示:无效的目标发行版:1.8。应改为小于等于安装的版本号

温馨提示:答案为网友推荐,仅供参考