求助!!Unable to compile class for JSP: 5
代码如下:<%@pagecontentType="text/html;charset=GBK"language="java"errorPage=""%><html><he...
代码如下:
<%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
<html>
<head>
<title>欢迎</title>
</head>
<body>
欢迎学习java web知识
<%out.println(new java.util.Data());%>
</body>
</html>
运行结果:
org.apache.jasper.JasperException: Unable to compile class for JSP:
求解决方法!!!! 展开
<%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
<html>
<head>
<title>欢迎</title>
</head>
<body>
欢迎学习java web知识
<%out.println(new java.util.Data());%>
</body>
</html>
运行结果:
org.apache.jasper.JasperException: Unable to compile class for JSP:
求解决方法!!!! 展开
2个回答
展开全部
页面没有引用你要使用的java库,编译不通过。
页面最上面加上<%@ page import="java.util.Date" %>。
页面最上面加上<%@ page import="java.util.Date" %>。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1,检查是否将classpath设置错误:正确的为.;%java_home%/lib/rt.jar;%java_home%/lib/tools.jar <!--java_home is your jdk directory-->
2,This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
看到了吗?
把jdk安装目录下的lib/tools.jar拷贝到tomcat安装目录下的common/lib目录下,然后重启tomcat,试试 。
3,设置tomcat的字符集为GBK,预防乱码的产生:F:/Tomcat 5.0/conf目录下的server.xml中增加一个参数URIEncoding="GBK"for example: <Connector URIEncoding="GBK"
port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
4,增大tomcat的jvm内存使用参数:在F:/Tomcat 5.0/bin目录下的catalina.bat文件中增加set JAVA_OPTS=-Xms256m -Xmx512mfor example: the first word is added by us.set JAVA_OPTS=-Xms384m -Xmx768m
set _EXECJAVA=%_RUNJAVA%
set MAINCLASS=org.apache.catalina.startup.Bootstrap
set ACTION=start
set SECURITY_POLICY_FILE=
set DEBUG_OPTS=
set JPDA=
2,This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
看到了吗?
把jdk安装目录下的lib/tools.jar拷贝到tomcat安装目录下的common/lib目录下,然后重启tomcat,试试 。
3,设置tomcat的字符集为GBK,预防乱码的产生:F:/Tomcat 5.0/conf目录下的server.xml中增加一个参数URIEncoding="GBK"for example: <Connector URIEncoding="GBK"
port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
4,增大tomcat的jvm内存使用参数:在F:/Tomcat 5.0/bin目录下的catalina.bat文件中增加set JAVA_OPTS=-Xms256m -Xmx512mfor example: the first word is added by us.set JAVA_OPTS=-Xms384m -Xmx768m
set _EXECJAVA=%_RUNJAVA%
set MAINCLASS=org.apache.catalina.startup.Bootstrap
set ACTION=start
set SECURITY_POLICY_FILE=
set DEBUG_OPTS=
set JPDA=
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询