码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-11-23 16:08:30      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:ack   second   参考   port   accept   size   log   you   技术   

问题描述:

 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

标签:ack   second   参考   port   accept   size   log   you   技术   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!