Java isEmpty() undefined for String?

Viewed 46182

I'm working on a school project in eclipse, and when I try and use the isEmpty() method on a String, Eclipse shows up the following error:

The method isEmpty() is undefined for the type String

I've run the Java updates, but am still getting it. Is any reason why this method would be undefined?

4 Answers

I had this problem in a big project where all previous set-up were with Java 8 (general and project level compiler settings). The solution was to move to the top The "JRE System Library[jre1.8.0]" in the "Order and Export" tab in Build Path of the affected project.

Related