org.apache.jasper.JasperException: Unable to compile class for JSP 解决方法

org.apache.jasper.JasperException: Unable to compile class for JSP 解决方法

(最近经常在论坛上看到问这个错误的朋友,这几天不下于4次了,在网上搜集整理一下,大家参考一下)

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 -Xmx512m
for 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=

你可能感兴趣的:(JasperException)