I was getting errors about Java 5 language level. ...
# intellij
m
I was getting errors about Java 5 language level. Set 7 everywhere in Project Structure and Settings. Getting problem with 'diamond' (
new TreeSet<>()
)
Wrong 1st argument type. Found: java.util.TreeSet<java.lang.Object>, required: java.util.Set<java.lang.Long>
And where are these memory tools? Can't find any mentions in the blog. Actually, new IDEA looks faster, has better icons, and I really like parameter name badges. ❤️
j
miha-x64: Are you using Maven? Maven is set to Java5 by default, unless you specify explicitly which version of Java to use.
m
Oh. Thank you, I've forgot
sourceCompatibility
in my build.gradle 🙂
j
👍
m
Actually, this not helped. I've got Oracle Java 1.8.0_121 as project SDK, Java 7 as Project language level, 1.7 as Project Bytecode Version, and
sourceCompatibility = 1.7
in build.gradle. Compiler continues treating
new TreeMap<>()
as
new TreeMap<Object>()
.
s
i think this is a Java 8 feature
m
@sksk Diamond is Java 7 feature.