Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK

tomcat下如何配置jsp、servlet,经产遇到环境配置问题,例如:

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.

 

 

解决方法:

通过更改Tomcat( 我用的是Tomcat 5.0.28)的Java Classpath, 问题解决!

 

我遇到过类似的情况:
http://www.cnblogs.com/zhengyun_ustc/archive/2006/03/11/174348.html#347629

我的解决办法是:
原先安装的是j2sdk-1_4_1_02-windows-i586
最开始安装的是j2sdk-1_4_1_02-windows-i586.exe,看页面的提示,就把tools.jar复制到tomcat目录下,还是不行。

最终安装了j2sdk-1_4_2_08-windows-i586-p.exe:
把原来的j2sdk卸载,安装了最新的j2sdk-1_4_2_08-windows-i586-p.exe。并没有设置什么AXIS_HOME、AXIS_LIB等系统变量,只要把这个版本的D:/j2sdk1.4.2_08/lib/Tools.jar复制到D:/Tomcat 5.0/common/lib下,重启动Tomcat,就可以浏览Axis了。

并且以前发布的web service,也可以正常浏览了。

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值