IntelliJ: Fatal error compiling: invalid target release: 1.8

前端 未结 3 963
遥遥无期
遥遥无期 2021-01-05 19:08

I\'m running a Java Maven project on IntelliJ, and I make sure that this project will be compiled by Java 1.8.

I set JRE to version 8 in Run/Debug Configuration

3条回答
  •  遥遥无期
    2021-01-05 19:13

    • 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.

提交回复
热议问题