Unable to find a javac compiler---JBOSS

Unable to find a javac compiler

启动Jboss 进入http://localhost:8080/

点击JMX Console 出现了以下 异常

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:439)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
      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:105)
      org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:929)
      org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758)
      org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
      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)

我在网上查了一下 说是在由于classpath 缺少tools.jar。由于我们用的是jbossIDE 因此就没有必要在 我的电脑属性高级环境变量中设置classpath

于是把jdk1.5.0_06/lib下的tools.jar 拷贝到/jboss-4.0.1sp1/server/default/lib

问题解决!

在用tomcat 开发jsp时也有可能出现此问题

adding the tools.jar to the $Tomcat_Home/common/lib solved the problem.

我想可能是因为jboss 本身内附tomcat的原因

-------------------------------------

另一种解决方案

重装JBOSS,之后用eclipse部署。这样就行了。

-----------------------------------------------------------------------

另外一种方案(这个方案是2009年3月26日所加,可能行不通,但是可以尝试一下):设置JAVA_HOME

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值