HTTP Status 500 - --------------------------------------------------------------------------------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 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)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.28

解决方案 »

  1.   

    环境变量配置错误,没有指定正确的JAVA_HOME
    在tomcat的startup.bat文件,最开始,加上:
    set JAVA_HOME=d:\jdk1.6
    此处假设d:\jdk1.6是你的jdk安装路径。
    或者在环境变量里面加上JAVA_HOME 
      

  2.   

    是不是用记事本打开那个文件,然后在最前面加上set JAVA_HOME=d:\jdk1.6啊
      

  3.   

    bat文件啊,里面都是文本,跟txt没区别。
      

  4.   

    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 
    这里说了你的JAVA_HOME不是指向jdk。你怎么改的给我看看。
      

  5.   

    startup MS-DOS批处理文件set JAVA_HOME=d:\jdk1.6.0@echo off
    if "%OS%" == "Windows_NT" setlocal
    rem ---------------------------------------------------------------------------
    rem Start script for the CATALINA Server
    rem
    rem $Id: startup.bat,v 1.6 2004/05/27 18:25:11 yoavs Exp $
    rem ---------------------------------------------------------------------------
      

  6.   

    加在rem后面。
    rem Guess CATALINA_HOME if not definedset JAVA_HOME=d:\jdk1.6.0 set CURRENT_DIR=%cd%
      

  7.   

    我的startup.bat:
    我的jdk路径是D:\Program Files\Java\jdk1.6.0_01@echo off
    if "%OS%" == "Windows_NT" setlocal
    rem ---------------------------------------------------------------------------
    rem Start script for the CATALINA Server
    rem
    rem $Id: startup.bat 302918 2004-05-27 18:25:11Z yoavs $
    rem ---------------------------------------------------------------------------rem Guess CATALINA_HOME if not definedrem 自己指定java_home
    set JAVA_HOME=D:\Program Files\Java\jdk1.6.0_01set CURRENT_DIR=%cd%
    if not "%CATALINA_HOME%" == "" goto gotHome
    set CATALINA_HOME=%CURRENT_DIR%
    if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
    cd ..
    set CATALINA_HOME=%cd%
    cd %CURRENT_DIR%
    :gotHome
    if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
    echo The CATALINA_HOME environment variable is not defined correctly
    echo This environment variable is needed to run this program
    goto end
    :okHomeset EXECUTABLE=%CATALINA_HOME%\bin\catalina.batrem Check that target executable exists
    if exist "%EXECUTABLE%" goto okExec
    echo Cannot find %EXECUTABLE%
    echo This file is needed to run this program
    goto end
    :okExecrem Get remaining unshifted command line arguments and save them in the
    set CMD_LINE_ARGS=
    :setArgs
    if ""%1""=="""" goto doneSetArgs
    set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
    shift
    goto setArgs
    :doneSetArgscall "%EXECUTABLE%" start %CMD_LINE_ARGS%:end
      

  8.   

    你的jdk不对吧?你的jdk目录下面有没有jre目录?如果没有jre目录,那你就指向了jre而不是jdk。
      

  9.   

    你是安装在D盘的吗?
    是不是高级设置里环境变量里的path的路径啊?
      

  10.   

    环境变量,你可以增加用户的也可以增加系统的
    点环境变量哪里的
    新建
    变量名填JAVA_HOME
    变量值填你的jdk路径啊。不明白你的jdk装在哪里,对不对
      

  11.   


       System.out.pritnln("ffsdfsadfasdf");
      

  12.   

    真牛,都直接用bat配置了,我直接配置的用户变量