How to change from -source 1.6 to -source 7 in Int

2019-02-05 16:58发布

I' trying to build a in IntelliJ IDEA project that is not mine and I got the following error:

java: diamond operator is not supported in -source 1.6 (use -source 7 or higher to enable diamond operator)

How do I change this setting in IntelliJ IDEA?

7条回答
小情绪 Triste *
2楼-- · 2019-02-05 17:45

For me, above answers didn't work, although they helped me solve my issue. At module level build.gradle do the following:

compileOptions {
        // I've changed below values from VERSION_1_6 to VERSION_1_7
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
查看更多
登录 后发表回答