The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

时间:2021-10-29 17:20:25

问题描述:

 The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

 

问题的根源:

down vote
accepted
Java 8 supports default methods in interfaces. And in JDK 8 a lot of old interfaces now have new default methods. For example, now in CharSequence we have chars and codePoints methods.
If source level of your project is lower than 1.8, then compiler doesn't allow you to use default methods in interfaces. So it cannot compile classes that directly on indirectly depend on this interfaces.
If I get your problem right, then you have two solutions. First solution is to rollback to JDK 7, then you will use old CharSequence interface without default methods. Second solution is to set source level of your project to 1.8, then your compiler will not complain about default methods in interfaces.

翻译:就是版本对不上了

 

解决方案:

   1、对JDK进行降级。 

   2、对IDE进行升级(或者换一个高版本的Eclipse、idea)

 

 JDK 降级效果图

 The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

 

参考网址:https://blog.csdn.net/t131452n/article/details/53005913