I am running:
But no dice. The compiler recognizes plain old AbstractMap
declarations, but has no clue about AbstractMap.SimpleEntry
or AbstractMap.SimpleImmutableEntry
:
However, via command line (javac 1.6.0_51
) the following does build and run:
import java.util.AbstractMap;
public class Test {
public static void main (String args[]) {
AbstractMap.SimpleImmutableEntry<String, String> entry =
new AbstractMap.SimpleImmutableEntry("key", "value");
System.out.println(entry.getKey());
System.out.println(entry.getValue());
}
}
Also, Android Studio (I/O Preview) recognizes AbstractMap.SimpleImmutableEntry
.
I have Build -> Clean'd, restarted Eclipse, rebooted the Mac. So something is wrong in my Eclipse setup. Help!
Are you sure you are building with level 17 of the SDK? AbstractMap.SimpleImmutableEntry
was added in API level 9. That exact class caught me out too as I build with API level 8.