2 Replies Latest reply on Jan 21, 2005 6:49 PM by stevecoh2

    Unable to find a javac compiler;

    José DESGRIS Newbie

      Hello,

      I am running JBOSS 4.0 on a fedora core 2. I have installed J2EE 1.4 to implement Java Beans classes.

      I have tried to run JBoss with jdk 5.0 and jdk 1.4.2 but it wouldn't compile the files. Here is the error I get when I run http://localhost:8080/jmx-console/ in firefox :

      type Exception report

      message

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

      exception

      org.apache.jasper.JasperException: Impossible de compiler la classe pour la 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)

      ...

      Here is the /etc/profile.d/java.sh file I wrote to set the environnement variables for all users :

      #export JREHOME="/usr/lib/jre/lib/i386"
      #export JAVAWSHOME="/usr/lib/jre/javaws"
      #export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JREHOME:$JAVAWSHOME"
      #export PATH="$PATH:/usr/lib/jre/bin"
      export JAVA_HOME="/usr/java/jdk1.4.2_06"
      export JDK_HOME="usr/java/j2sdk1.4.2_06"
      export PATH="$JAVA_HOME/bin:$PATH"
      export PATH="/opt/SUNWappserver/bin:$PATH"
      export PATH="/opt/SUNWappserver/share/bin:$PATH"
      export CLASSPATH="$JAVA_HOME:/opt/SUNWappserver/lib/j2ee.jar"
      export CLASSPATH="$CLASSPATH:/usr/java/j2sdk1.4.2_06/lib/tools.jar"
      #export CLASSPATH="$CLASSPATH:/usr/java/j2sdk1.4.2_06/lib/rt.jar:./"

      Is there something wrong with my configuration file ?

      Best regards,

      José
      Student Paris - France

        • 1. Re: Unable to find a javac compiler;
          Bernd Zeitler Expert

          typo??

          export JAVA_HOME="/usr/java/jdk1.4.2_06"
          export JDK_HOME="usr/java/j2sdk1.4.2_06"


          JAVA_HOME must point to a correctly installed JDK!

          • 2. Re: Unable to find a javac compiler;
            stevecoh2 Newbie

            I am experiencing a similar problem.
            OS Win/2K
            JBoss Version 3.2.5
            JBoss IDE version 1.4.0
            Eclipse Version 3.0.1

            Two problems:
            First, on starting server

            17:37:56,454 ERROR [HANamingService] Could not start on port 1100
            java.net.BindException: Address already in use: JVM_Bind
            at java.net.PlainSocketImpl.socketBind(Native Method)
            at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
            at java.net.ServerSocket.bind(ServerSocket.java:318)
            at java.net.ServerSocket.(ServerSocket.java:185)
            at org.jboss.ha.jndi.DetachedHANamingService.startService(DetachedHANamingService.java:223)
            ...

            If I ignore this and try to run my web app, I get on the web page:

            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:810)

            Yet:
            U:\>set JAVA_HOME
            JAVA_HOME=C:\j2sdk1.4.2_05

            U:\>set JDK_HOME
            JDK_HOME=C:\j2sdk1.4.2_05

            Inside Eclipse, the "Window-Preferences-Java-Installed Runtime JREs"
            also points at C:\j2sdk1.4.2_05.

            What is this port 1100? Nothing in my jboss-service.xml points there.