in a java program , I have the following line of code :
HashMap<String, String> query_args = new HashMap<>();
and i receive the following error:
'<>' operator is not allowed for source level below 1.7
I tried to change the project compliance and jre to 1.7 but then eclipse could not resolve the imports. I am using jre 1.6.
Any suggestions?
"Why <> operator is not allowed for source below 1.7"
-- because it was defined in Java 1.7. Kind of a silly question actually. A possible solution: upgrade your Eclipse to allow 1.7. If your question is more about why the error message, then your title should reflect this.