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
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.
In the Project Structure dialog Ctrl+Alt+Shift+S , select SDKs. Select the necessary JDK version if you have several JDKs configured, and open the Documentation Path tab on the right.
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S . Under Project Settings, select Modules | Sources. From the Language level list, select the necessary option. To use the project language level, select Project default.
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.
As an alternative solution, which worked for me is to check in Module Settings the Language Level property. It was set to 8.0 Lambdas
and changed to 6.0 @Overrides in interfaces
, and after that compilation worked without error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With