We have a Maven-based Android build, and we just made the switch from JDK 6 to 7.
This is due to his share in IntelliJ issues. It happens that every time he detects changes in the POM and refins / updates the project, he returns to selecting the old "SDK module", which is configured to use Java 6:

Even if I manually remove these SDKs from the Platform Settings dialog box, they will again appear as βMaven Android API 19 Platform (N),β where N is the number used to disambiguate it from all the other (identical) SDKs.
I must mention that we indicate in POM that Java 7 is aimed. I tried to set both the language level of the compiler plugin and the maven.compiler.* (not sure if this is the same or not), with no luck:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin>
should IntelliJ choose this and always configure the project to use the Java 7 SDK? Did I miss something?
I noticed that the problem disappears when I delete links to the 1.6 SDK completely in IntelliJ. Not surprisingly, I think, but also not viable, as I have other projects that still rely on having the Java 6 SDK.
source share