Compile error occurs in JSP after upgrading to JDK8: "The type java.lang.CharSequence cannot be resolved"
I recently updated my JDK version to 8. I have a piece of code that looks like this:
StringBuilder abc = new StringBuilder();
abc.append("123");
when i run this it throws an error:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
I updated all the JDK dependencies, but it helped.
+3
source to share
2 answers
I just got hurt yesterday. This is because your server (tomcat I guess?) Does not support Java 8 (for your version).
It is known that tomcat6 and some of the first tomcat7 version do not support Java 8 . You will need to update your server or compile it with Java 7.
From the link I leave below, Brett Brian said:
I can confirm that apache-tomcat-7.0.35 does NOT support JDK8, I can also confirm that apache-tomcat-7.0.50 has support for JDK8.
+3
source to share