引入apache commons-lang3-3.12.0.jar包, StringUtils类无法识别,3.11及以下版本都没问题,3.12及以上版本都不行,请教下是什么原因?

引入apache commons-lang3-3.12.0.jar包, StringUtils类无法识别,3.11及以下版本都没问题,3.12及以上版本都不行,请教下是什么原因?

阿里嘎多学长整理AIGC生成,因移动端显示问题导致当前答案未能完全显示,请使用PC端查看更加详细的解答过程
问题分析
解决方案
核心代码
// 检查StringUtils类是否存在
if (StringUtils.class != null) {
// 使用StringUtils类
String str = StringUtils.isEmpty("test");
System.out.println(str);
} else {
System.out.println("StringUtils类不存在");
}
注意