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


    问题描述:

     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

  • 相关阅读:
    python之元组
    python之dict
    python之list
    python之str字符串
    python之for循环
    Python的基本语法2
    Python的基本语法1
    初识python
    JS获取当天是周几
    EXCLE导入数据库
  • 原文地址:https://www.cnblogs.com/7q4w1e/p/10007932.html
Copyright © 2020-2023  润新知