I have jre7 installed on my pc. In Eclipse Kepler I created a project with compiler compliance level 1.5. The source compatibility setting is 1.5 too. But this setting not works.
I can wirte code which using methods that were declared in 1.6 or later. For example:
String s = "aaa";
boolean b = s.isEmpty();
The method isEmpty() in java.lang.String is since 1.6.
Of course, when running the generated class file with a real jre 1.5 enviroment, i got a NoSuchMethodError exception.
Here is my source and settings:
How can I fix this? Or is it an Eclipse bug?