Java source level changes each time maven reindexes
已回答
Ever since I upgraded to 2016.2.4 , the java source level is changed to 1.5 each time the maven project is reindexed. I constantly need to go changing this, even though the pom explicitly says that both source and target should be 1.8.
I event get a compile error saying "source release 1.8 requires target release 1.8" from time to time. This didn't happen before the update.
Any hints?
请先登录再写评论。
Make sure you specify 1.8 level in pom.xml: https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html.
As I said in the post, that is correctly defined in the pom. I just downgraded to 2016.1.4 and the problem dissapeared
There are some known issues when maven-compiler-plugin language level is not detected correctly:
https://youtrack.jetbrains.com/issue/IDEA-115977
https://youtrack.jetbrains.com/issue/IDEA-146143
https://youtrack.jetbrains.com/issue/IDEA-81494
https://youtrack.jetbrains.com/issue/IDEA-125908
https://youtrack.jetbrains.com/issue/IDEA-76209
This type of thing happens constantly on upgrade. I upgraded this morning, and I am now spending hours trying to figure out why a project that DID compile before the upgrade now says "Error:java: javacTask: source release 1.8 requires target release 1.8".
No code change at all. Just an 'up'grade. This has happened on so many versions of Intellij that I almost always refuse the upgrades. This mrning I was not paying enough attention.
This is incredibly frustrating and costs me enormous amounts of time. I would really appreciate it if there was SOME indication as to what project/file/setting/black magic was causing this to happen repeatedly.
See http://stackoverflow.com/a/12900859/104891.