IntelliJ: Fatal error compiling: invalid target release: 1.8

与世无争的帅哥 提交于 2019-11-30 22:28:29

I assume you want to have it in version 8, despite so many comments telling you to set to 7.

You probably missed the setting for the maven runner, this is under Preferences -> Build, Exection, Deployment > Build Tools > Maven > Runner, see attached image. You need to set that to Java 8 as well.

Look in Build Execution, Deployment > Compiler > Java Compiler

Then look for per module bytecode version

  • Make sure JAVA_HOME is set to JDK7 or JRE7. This is explained in the following link

  • Make sure that you open a new shell an run intellij

  • If this doesnt work, look at at the idea.bat file which is used to run intellij - make sure it uses jdk7/jre7
  • Make sure the JDKs are defined properly in your project. Look at this link for more information.
  • Make sure that the source is defined as 1.7 at maven

The above 4 steps always helped me to troubleshoot such issues.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!