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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ceovip/article/details/81196689

在Jsp代码里面出现“The type java.lang.CharSequence cannot be resolved”错误提示,从提示信息可以看出这个问题应该是哪里配置不对或者软件版本不兼容等问题造成的。
ChartSequence

开发环境和配置如下:
win7 64bit
jdk 1.8
MyEclipse版本:Version: 8.6.1,Build id: 8.6.1-20101117

后来在stackoverflow上查到,这是由于IDE本身支持的编译器版本和jre版本不匹配导致的。参考地址:
http://stackoverflow.com/questions/24301986/the-type-java-lang-charsequence-cannot-be-resolved-in-package-declaration
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

Windows -> Preference里面,Installed JREs选择低版本的那一个,点击OK按钮,保存设置。重新打开之前出错的jsp文件,发现没有错误了。
jre设置

猜你喜欢

转载自blog.csdn.net/ceovip/article/details/81196689