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

很不幸,最近在学习 Spring boot 时处处遇到困难,我升级了 JDK 到 1.8 之后,Eclipse 开始报各种错。其中一个错误就是我们今天要说的“The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files”问题。

这个问题的大概意思时说:无法解析 java.lang.CharSequence 类型。它是 .class 文件中间直接引用的。说白了就是 java.lang.CharSequence 类型无法解析。

很奇怪啊,我在 StringBuffer 中 append 字符串居然报这种错误。不应该啊,后来通过百度搜索,发现 stackoverflow 中有一个网友解答的还是很高深。

造成这个问题的原因是 Eclipse 版本过低,不支持 JDK 1.8。

Eclipse JDK 版本

可以看到这里的编译版本中只能选择到 1.6。因此,最好的办法是对 Eclipse 进行升级。或者对你当前项目的 jdk 使用版本进行降价。

解决 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

原创文章,作者:254126420,如若转载,请注明出处:https://blog.ytso.com/tech/java/251744.html

(0)
上一篇 2022年5月3日 12:25
下一篇 2022年5月3日 12:29

相关推荐

发表回复

登录后才能评论