jsp字符串的split(String)方法未定义:The method split(String) is undefined for the type String
org.apache.jasper.JasperException:UnabletocompileclassforJSP:Anerroroccurredatline:11...
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 11 in the jsp file: /jsp/include/include.jsp
The method split(String) is undefined for the type String
8: System.out.println(System.getProperty("java.version"));
9: System.out.println(System.getProperty("java.library.path"));
10: String saaa = "1,2,3,4";
11: System.out.println(saaa.split(",").length);
12: System.out.println("=========================================");
13: %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:443)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
......
估计是jdk版本问题。但是1.4之前才会出现这个错吧。我用的是jdk1.7.
System.out.println(System.getProperty("java.version"));
System.out.println(System.getProperty("java.library.path"));
输出也都是1.7. 到底哪里出了问题?
环境里加了两个兼容性的设置
-Djava.util.Arrays.useLegacyMergeSort=true
-Djava.awt.headless=true
应该没影响吧
源文件:
......
<%@ page import="java.lang.*"%>
<%
System.out.println(System.getProperty("java.version"));
System.out.println(System.getProperty("java.library.path"));
String saaa = "1,2,3,4";
System.out.println(saaa.split(",").length);
System.out.println("=========================================");
%> 展开
An error occurred at line: 11 in the jsp file: /jsp/include/include.jsp
The method split(String) is undefined for the type String
8: System.out.println(System.getProperty("java.version"));
9: System.out.println(System.getProperty("java.library.path"));
10: String saaa = "1,2,3,4";
11: System.out.println(saaa.split(",").length);
12: System.out.println("=========================================");
13: %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:443)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
......
估计是jdk版本问题。但是1.4之前才会出现这个错吧。我用的是jdk1.7.
System.out.println(System.getProperty("java.version"));
System.out.println(System.getProperty("java.library.path"));
输出也都是1.7. 到底哪里出了问题?
环境里加了两个兼容性的设置
-Djava.util.Arrays.useLegacyMergeSort=true
-Djava.awt.headless=true
应该没影响吧
源文件:
......
<%@ page import="java.lang.*"%>
<%
System.out.println(System.getProperty("java.version"));
System.out.println(System.getProperty("java.library.path"));
String saaa = "1,2,3,4";
System.out.println(saaa.split(",").length);
System.out.println("=========================================");
%> 展开
2014-06-07
展开全部
自己检查下jdk版本到底引用的哪个了,好好检查下吧,实现不行,把自己机器上的JDK和JRE全部删除掉重新安装下,可能你的电脑还存在低的JDK,看下TOMCAT中引用的是哪个jdk了。
追问
终于找到了。在引用的一个外部jar包里居然自带java.lang......jdk被覆盖了。好坑
还是谢谢你!解决问题。撒花!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询