不知道为什么我的TOMCAT配置老是出问题,请大家指教一下?
我将JDK安装在C:\Program Files\Java\jdk1.6.0
TOMCAT安装在C:\Program Files\Apache Software Foundation\Tomcat 5.0
JAVA_HOME=C:\Program Files\Java\jdk1.6.0
path=%JAVA_HOME%/bin
classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; %JAVA_HOME%
\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet-api.jar
CATALINA_BASE=C:\Program Files\Apache Software Foundation\Tomcat 5.0
CATALINA_HOME=C:\Program Files\Apache Software Foundation\Tomcat 5.0
TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 5.0
我在ROOT目录下有一个WebJsp.jsp如下:
<%@ page language= "java " contentType= "text/html;charset=GBK "%>
<%!int number=0;
synchronized void countPeople()
{
number++;
}
%>
<%
countPeople();
%>
你是第 <%out.println(number);%> 个访问本站的客户.
但是在浏览器中用: "http://localhost:8080 "测试时没有出问题,但是用
: "http://localhost:8080/WebJsp.jsp "时,tomcat出现如下报错信息:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
jav