5 Replies Latest reply on Oct 23, 2002 2:28 AM by wmprice1240

    CLASSPATH and tools.jar

    jdware

      Hi,
      When I run jboss 3.0.3 like this:

      java -cp "$CLASSPATH" -jar run.jar

      the server starts up fine but when I try to access localhost:8080/jmx-console I get the sun.tools.javac.Main classdef not found error.

      16:37:42,818 WARN [jbossweb] WARNING: Exception for /jmx-console/
      java.lang.NoClassDefFoundError: sun/tools/javac/Main
      at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:136)

      I assume that tools.jar is in my CLASSPATH for I can run:

      java -cp "$CLASSPATH" sun.tools.javac.Main and I get the javac usage message as expected.

      It seems like the servlet container is not being passed the classpath correctly by jboss. Does jetty get it's classpath from jboss or read an environment variable.

      thanks

      john ware



        • 1. Re: CLASSPATH and tools.jar
          prabhakar

          Why are you running it this way? Why don't you use the run.bat or run.sh which add everything you need to the classpath for you?

          -prabhakar

          • 2. Re: CLASSPATH and tools.jar

            Jasper requires JAVA_HOME env variable to be set to locate the sun compiler classes. However, you should not use a system classpath to start the server as pointed by previous poster.

            • 3. Re: CLASSPATH and tools.jar
              jdware

              I enjoy learning exactly how to run things and to be in complete control of what I am running.

              Besides the run.sh script generates so many errors I can't tell if jboss started properly or not.

              john

              • 4. Re: CLASSPATH and tools.jar

                And I'm telling you adding too many libs into your system classpath rather than letting the JBoss classloading mechanism take care of it may land you into unexpected trouble later.

                But if you want to learn it the hard way.... ;-)

                • 5. Re: CLASSPATH and tools.jar
                  wmprice1240

                  Well, I think it's a pretty good idea to boot the server with the supplied run.sh or run.bat file. At least you should try and determine why the script is failing and fix the cause of those problems first.

                  However, if you really want to start JBoss your way you can look at run.sh and determine the necessary steps the script is performing to start the server. Then you merely have to add the appropriate options to the java command line.

                  Regards,

                  Weston M. Price