ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Quirk" <>
Subject Re: java.lang.NoClassDefFoundError: sun/tools/javac/Main Error
Date Sun, 29 Dec 2002 18:29:18 GMT

Thanks for the reply. However, tools.jar is in the classpath. Here is the
portion of the build file that sets the classpath.  Any other ideas?

<!-- Set Jar Properties -->
<property name="log4j.jar" location="${lib.dir}/log4j/log4j-1.2.6.jar"/>
<property name="jdom.jar" location="${lib.dir}/jdom/jdom.jar"/>
<property name="jaxp.jar" location="${lib.dir}/jaxp/jaxp.jar"/>
<property name="parser.jar" location="${lib.dir}/jaxp/parser.jar"/>
<property name="jconnect.jar" location="${lib.dir}/jconnect/jconn2.jar"/>
<property name="ssce.jar" location="${lib.dir}/ssce/ssce.jar"/>
<property name="etools.jar" location="${lib.dir}/stylereport/etools.jar"/>
<property name="sree_pro.jar" location="
<property name="junit.jar" location="${lib.dir}/junit/junit.jar"/>
<property name="unittest.jar" location="${lib.dir}/junit/unittest.jar"/>
<property name="tools.jar" location="${silverstream.lib}/tools.jar"/>

<!-- Set Compile Classpath -->
<path id="compile.classpath">
      <pathelement location="${etools.jar}"/>
      <pathelement location="${tools.jar}"/>
      <pathelement location="${jconnect.jar}"/>
      <pathelement location="${jdom.jar}"/>
      <pathelement location="${ssce.jar}"/>
      <pathelement location="${jaxp.jar}"/>
      <pathelement location="${log4j.jar}"/>
      <pathelement location="${parser.jar}"/>
      <pathelement location="${sree_pro.jar}"/>
      <pathelement location="${junit.jar}"/>
      <pathelement location="${unittest.jar}"/>

      <!-- <pathelement location="${silverstream.lib}"/> -->
      <!-- This puts tools.jar in the classpath again, the above was just
to make sure it was getting in -->
      <fileset dir="c:/silverstream37/lib" casesensitive="false">
             <include name="*.jar"/>
             <include name="*.zip"/>


                             To:       Ant Users List <>
                      12/28/02 12:14 PM        Subject:  Re: java.lang.NoClassDefFoundError:
sun/tools/javac/Main Error                
                      Please respond to                                                  
                      "Ant Users List"                                                   

Looks like that you do not have tools.jar in the
${compile.classpath}. include that in the classpath and that
should work.


---- Original message ----
>Date: Fri, 27 Dec 2002 19:34:38 -0500
>From: "Brian Quirk" <>
>Subject: java.lang.NoClassDefFoundError:
sun/tools/javac/Main Error
>Hi -
>Ant compiles beautifully when I use JDK 1.3.0_02. However,
I'm trying to
>use a different compiler and receive the following error:
>[javac] Since fork is true, ignoring compiler setting.
>[javac] Compiling 705 source files to
>[javac] Since fork is true, ignoring compiler setting.
>[javac] java.lang.NoClassDefFoundError: sun/tools/javac/Main
>[javac] Exception in thread "main"
>Here is my build file snippet:
><target name="compile" depends="init" description="Compile
the source
>      <!-- Compile the java code from ${src.dir} into 
${build.dir} -->
>      <javac srcdir="${src.dir}"
>             destdir="${build.dir}"
>             fork="yes"
>             executable="c:/silverstream37/jre/bin/javac"
>             compiler="javac1.2">
>             <classpath refid="compile.classpath"/>
>      </javac>
>I believe this is related to tools.jar, but aren't sure how
to get around
>the issue. Any advice is very appreciated.
>- ps - I hope I haven't done something too stupid - I am
very new to ANT.
>To unsubscribe, e-mail:   <mailto:ant-user->
>For additional commands, e-mail: <mailto:ant-user->

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message