2 Replies Latest reply on Aug 11, 2005 10:10 AM by Chris Mc

    JAVA HOME PROBLEM

    Jordi Miro Newbie

      Hello,

      I have an application that is running with jboss and has been running for the last 2 months. I am getting this log:

      HTTP Status 500 -

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

      type Exception report

      message

      description The server encountered an internal error () that prevented it from fulfilling this request.

      exception

      org.apache.jasper.JasperException: No se puede compilar la clase para 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:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


      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: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:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


      note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.


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

      Apache Tomcat/5.0.28

      I have declared a system variable for JAVA_HOME, but my eclipse is pointing to higher version. What is the problem? Any help will be thanked.

      Kind Regards,

      Jordi

        • 1. Re: JAVA HOME PROBLEM
          Darran Lofthouse Master

          How are you starting JBoss, are you starting it from the command line or from Eclipse?

          • 2. Re: JAVA HOME PROBLEM
            Chris Mc Newbie

            Java development kits (those from which you can compile code) all come with a tools.jar file in the lib/ directory of the kits.

            JBoss needs that file to run.

            First, make sure your JAVA_HOME points to the directory of a development kit. That directory's "lib" sub directory will have a tools.jar in it, or it isn't a development kit. In other words, $JAVA_HOME/lib/tools.jar should exist.

            For example, my JAVA_HOME=/usr/java/j2sdk1.4.2_06, and my tools.jar is /usr/java/j2sdk1.4.2_06/lib/tools.jar


            According to run.sh, JBoss uses the JAVA_HOME variable to determine which "java" runtime environment it should be using.

            If JBoss does not find a JAVA_HOME variable, it will use the "java" command that is on the path, and then just hopes that "tools.jar" is somewhere on the classpath.