How to change from -source 1.6 to -source 7 in IntelliJ IDEA

Ctrl+Alt+Shift+S (Project Structure icon)

Then change Project language level


I know the OP uses IntelliJ IDEA, but Android Studio is based on IntelliJ IDEA, so I wanna say one more word.

If you use Android Studio, command+;(for Mac) or File->Project Structure, then in the open window follow the settings:

enter image description here


And, if you're working with a maven project, for sanity, remember to set the java version in the pom too.

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>