You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Kumar, Senthil" <Se...@wfg.com> on 2000/10/18 23:13:03 UTC

build failed...?

Hi,
   Have u experienced this error. I can figure out what is the error...
help me if u know the cause of this error...
 
C:\CLAW\com\citadel\claw>ant
Buildfile: build.xml

init:

prepare:

compile:
    [javac] Compiling 20 source files to C:\claw\build

BUILD FAILED

java.lang.NoClassDefFoundError: sun/tools/javac/Main
        at org.apache.tools.ant.taskdefs.Javac.doClassicCompile(Compiled
Code)
        at org.apache.tools.ant.taskdefs.Javac.execute(Compiled Code)
        at org.apache.tools.ant.Target.execute(Compiled Code)
        at org.apache.tools.ant.Project.runTarget(Project.java:717)
        at org.apache.tools.ant.Project.executeTarget(Compiled Code)
        at org.apache.tools.ant.Project.executeTargets(Compiled Code)
        at org.apache.tools.ant.Main.runBuild(Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java:107)

Total time: 2 seconds

Senthil.


Build.xml
************

<project name="claw" default="dist" basedir=".">
  <target name="init">
    <tstamp/>
    <property name="build" value="c:/claw/build" />
    <property name="dist"  value="c:/claw/dist" />
    <property name="src" value="." />
    <filter token="version" value="1.0.3" />
    <filter token="year" value="2000" />
  </target>

  <target name="prepare" depends="init">
    <mkdir dir="${build}" />
  </target>

  <target name="compile" depends="prepare">
    <javac srcdir="${src}" destdir="${build}" filtering="on"/>
  </target>

  <target name="dist" depends="compile">
    <mkdir dir="${dist}/lib" />
    <jar jarfile="${dist}/lib/claw.jar"
     basedir="${build}" includes="com"/>
  </target>

  <target name="clean" depends="init">
    <deltree dir="${build}" />
    <deltree dir="${dist}" />
  </target>
</project>

***************

RE: build failed...?

Posted by Wes Moulder <wm...@axyssolutions.com>.
You need to put the jdk tools.jar (or classes.zip for pre 1.2) in the
classpath before running ant.  Specifying java_home in your system
environment before running the batch file should automagically do that for
you.  It's balking because it can't find a compiler.
--Wes
Axys Solutions, LLC

> -----Original Message-----
> From: Kumar, Senthil [mailto:Senthil.Kumar@wfg.com]
> Sent: Wednesday, October 18, 2000 4:13 PM
> To: ant-user@jakarta.apache.org
> Subject: build failed...?
>
>
> Hi,
>    Have u experienced this error. I can figure out what is
> the error...
> help me if u know the cause of this error...
>
> C:\CLAW\com\citadel\claw>ant
> Buildfile: build.xml
>
> init:
>
> prepare:
>
> compile:
>     [javac] Compiling 20 source files to C:\claw\build
>
> BUILD FAILED
>
> java.lang.NoClassDefFoundError: sun/tools/javac/Main
>         at
> org.apache.tools.ant.taskdefs.Javac.doClassicCompile(Compiled
> Code)
>         at org.apache.tools.ant.taskdefs.Javac.execute(Compiled Code)
>         at org.apache.tools.ant.Target.execute(Compiled Code)
>         at org.apache.tools.ant.Project.runTarget(Project.java:717)
>         at org.apache.tools.ant.Project.executeTarget(Compiled Code)
>         at org.apache.tools.ant.Project.executeTargets(Compiled Code)
>         at org.apache.tools.ant.Main.runBuild(Compiled Code)
>         at org.apache.tools.ant.Main.main(Main.java:107)
>
> Total time: 2 seconds
>
> Senthil.
>
>
> Build.xml
> ************
>
> <project name="claw" default="dist" basedir=".">
>   <target name="init">
>     <tstamp/>
>     <property name="build" value="c:/claw/build" />
>     <property name="dist"  value="c:/claw/dist" />
>     <property name="src" value="." />
>     <filter token="version" value="1.0.3" />
>     <filter token="year" value="2000" />
>   </target>
>
>   <target name="prepare" depends="init">
>     <mkdir dir="${build}" />
>   </target>
>
>   <target name="compile" depends="prepare">
>     <javac srcdir="${src}" destdir="${build}" filtering="on"/>
>   </target>
>
>   <target name="dist" depends="compile">
>     <mkdir dir="${dist}/lib" />
>     <jar jarfile="${dist}/lib/claw.jar"
>      basedir="${build}" includes="com"/>
>   </target>
>
>   <target name="clean" depends="init">
>     <deltree dir="${build}" />
>     <deltree dir="${dist}" />
>   </target>
> </project>
>
> ***************
>