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