IntelliJ IDEA 13 uses Java 1.5 despite setting to 1.7

后端 未结 13 856
我在风中等你
我在风中等你 2020-12-04 07:40

Despite specifying JDK 1.7 in all project settings (including in File -> Project Structure -> Project :: Project SDK), the following error is produced by

13条回答
  •  無奈伤痛
    2020-12-04 08:24

    I have same problem but with different situation. I can compile without any issue with maven in command line (mvn clean install), but in Intellij I always got "java: diamond operator is not supported in -source 1.5" compile error despite I have set the maven-compiler-plugin with java 1.8 in the pom.xml.

    It turned out I have remote repository setting in my maven's settings.xml which the project depends on, but Intellij uses his own maven which doesn't have same setting with my local maven.

    So my solution was changing the Intellij's maven setting (Settings -> Build, execution, Deployment -> Maven -> Maven home directory) to use the local maven.

提交回复
热议问题