Search code examples
javaintellij-ideajavac

Unable to compile using Java 1.7 in Jetbrains Intellij after moving from 1.6 to 1.7 (maven based project)


Using Jetbrains 11.2 project based on a Maven project. Then I required to move to 1.7. I have 1.7 installed , I updated my pom.xml and I can rebuild the whole package using maven okay.

I've modified every setting I can see in Intelli Projects settings regarding Java version

  • Project SDk
  • Project language Level
  • Modules Languages/Sources/Language Level
  • Modules Languages/Dependencies/Module SDK

but I cannot get it to compile a file it complains:

Error:javac target release of 1.6 conflicts with source release 1.7

I then tried on my other dev machine using the same codebase but a different Intellij Project and on this I get a similar error:

Error:javac: source release 1.7 requires target release 1.7

I cannot see anything else to change in order to get this working.


Solution

  • Doh, found it

    File/Settings/Java Compiler/Additional command line parameters

    changed from -target 1.6 to -target 1.7

    Does seem wierd for it to be here though, disconnected from the rest of the related options.