一个初学者的困惑
问一下各位:一个tomcat的配置问题我的jdk是装在 d:\jdk1.5
tomcat装在 d:\tomcat 下
进入 http://localhost:8080 能够看到欢迎界面
于是我又按照网上所说的那样在 D:\Tomcat\webapps 下建立了一个myapp目录,在此目录下又建立一个 index.jsp文件 和WEB-INF子目录,在WEB-INF目录下建了一个web.xml文件,这时我在浏览器中输入 http://localhost:8080/myapp/index.jsp
出现的页面出现以下文字:
type Exception report
message
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
这是怎么回事啊?我的环境变量如下:
CATALINA_BASE: D:\Tomcat
CATALINA_HOME: D:\Tomcat
TOMCAT_HOME: D:\Tomcat
JAVA_HOME: D:\jdk1.5
classpath: .;d:\jdk1.5\lib\dt.jar;d:\jdk1.5\lib\tools.jar;D:\Tomcat\common\lib\servlet.jar;
path: D:\jdk1.5\bin;%catalina_home%\bin
哪里弄错了吗?我谢谢大家了!
[解决办法]
JAVA_HOME does not point to the JDK
path 里面添加 %JAVA_HOME%\BIN
[解决办法]
你可以在CMD命令行使用javac 吗?
------解决方案--------------------
你是不是说错了?是放在root下的吧?
[解决办法]
找不到jdk
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html