JDK与tomcat的一个奇怪的问题 问了N多人都不知道 ?
我安装完JDK1.5 ,且配置好后,用 helloword.java 程序测试正常
然后安装完tomcat5.0.28 且配置好后,输入 http://localhost:8080/ 也能得出正常运行的画面(带猫的那个画面)。
具体的配置:
classpath .;C:\Program Files\Java\jdk1.5.0_04\lib\dt.jar;C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar
PATH C:\Program Files\Java\jdk1.5.0_04\bin;C:\Program Files\Java\jdk1.5.0_04\lib
JAVA_HOME C:\Program Files\Java\jdk1.5.0_04
CATALINA_HOME C:\Tomcat 5.0
但是我运行 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.
哪位高手能够指导一下 ,为什么 ? 是不是版本问题引起的
tomcat5.0.28+j2sdk1.5
谢谢了
------解决方案--------------------com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point t