Set Gradle project to use Java 1.7?

How do I have IDEA import a gradle project as java 1.7?

Having:

subprojects {
    apply plugin: 'java'
    sourceCompatibility = JavaVersion.VERSION_1_7
    targetCompatibility = JavaVersion.VERSION_1_7

}

at the top of my build.gradle doesn't affect things
2 comments

Hi Peter,

If you have Java SDK 1.7 configured at "Project Structure" => "Platform Settings" => "SDKs", Gradle plugin will choose it on project import.
See "Project Structure" => "Project Settings" => "Project SDK" and "Project language level" .
That should be enough.

Vlad

0

Yes, that's what I ended up doing. I was hoping there was a way to have it inferred from build.gradle, but this will do. Thanks!

0

Please sign in to leave a comment.