我是这样设置的:
1、将我的jsp网页全部放在test文件夹里(里面有个index.jsp)。
2、将test文件夹拷贝到webapps下。
3、设置conf下的server.xml:
   <ContextManager>         
       <Context path="/test" docBase="webapps/Test"/>
   </ContextManager>
  注意:我用的tomcat是5.0,在server.xml里没有contextmanager这一项,这里是我自己加上去的。不知道对不对?设置完成后,我就在浏览器上输入:http://localhost:8080/test/index.jsp
出现下面的错误:
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPNo Java compiler was found to compile the generated source for the JSP. 
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. 
If using an alternate Java compiler, please check its installation and access path. org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.这下,我就不懂了,请大家帮我。

解决方案 »

  1.   

    org.apache.jasper.JasperException: Unable to compile class for JSPNo Java compiler was found to compile the generated source for the JSP. 
    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. 
    If using an alternate Java compiler, please check its installation and access path.JAVA_HOME的环境变量设置了没有?
      

  2.   

    经过楼上朋友提醒:
    我设置了三个环境变量:
    JAVA_HOME : C:\jdk1.5.0_02
    Path :  %JAVA_HOME%\BIN;.....
    ClassPath : .;%JAVA_HOME%\lib\tools.jar可是,问题依然如题所表示的那样啊?!!!
    请大家帮忙,我是个初学者,没想到一开头就遇到这样的怪问题啊!。
      

  3.   

    lz按下面这句话说的试试:
    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. 
      

  4.   

    调出来了,感谢楼上指点。
    我没有注意到这一行字
    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. 意思是:将$JAVA_HOME/lib/tools.jar手动地拷贝到tomcat安装目录下的common/lib下,再然后重新启动Tomcat ,就行了。非常感谢啊!给分啦。