java.lang does not contain a class called StringUtils. Several third-party libs do, such as Apache Commons Lang or the Spring framework. Make sure you have the relevant jar in your project classpath and import the correct class.
java.lang does not contain a class called StringUtils. Several third-party libs do, such as Apache Commons Lang or the Spring framework. Make sure you have the relevant jar in your project classpath and import the correct class.
StringUtils is an Apache Commons project. You need to download and add the library to your classpath.
To use:
import org.apache.commons.lang3.StringUtils;
I believe you're using org.springframework.util.StringUtils, which has no isEmpty().
There is, however, an isEmpty() in org.apache.commons.lang.StringUtils.
Ensure that you're using the correct StringUtils.
However Question was Answered as expected long back, but I think one important point is a must to mention here (as now a days most of projects are Maven based). So don't forget to add maven dependency for 'apache common lang' in your projects POM.xml before importing StringUtils for same. Else there wont be any import option.
Copy<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>