首页 > 编程语言 > 详细

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

时间:2018-11-23 15:58:24      阅读:214      评论:0      收藏:0      [点我收藏+]

问题描述:

 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 降级效果图

 技术分享图片

 

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

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

原文:https://www.cnblogs.com/7q4w1e/p/10007932.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!