tags:

views:

32

answers:

2

Can anyone tell me why I am getting this error message

Buildfile: C:\Users\Tara\workspace\Testing\build.xml doc: [delete] Deleting directory C:\Users\Tara\workspace\Testing\doc [mkdir] Created dir: C:\Users\Tara\workspace\Testing\doc [javadoc] Generating Javadoc [javadoc] Javadoc execution

BUILD FAILED C:\Users\Tara\workspace\Testing\build.xml:24: Javadoc failed: java.io.IOException: Cannot run program "javadoc.exe": CreateProcess error=2, The system cannot find the file specified

Total time: 206 milliseconds

when I run this in Eclipse?

<project name="SimpleBuildScript" basedir="." default="doc">
<property file="build.properties"/>
    <target name="compile" description="Compiles the Task">
        <delete dir="${class.dir}"/>
        <mkdir dir="${class.dir}"/>
        <javac srcdir="src" destdir="classes"/>
    </target>
    <target name="clean" description="Delete all generated files">
        <delete dir="${class.dir}"/>
        <delete dir="${jar.dir}"/>
    </target>
    <target name="doc" description="generate documentation">
        <delete dir="${doc.dir}"/>
        <mkdir dir="${doc.dir}"/>
        <javadoc sourcepath="${source.dir}" destdir="${doc.dir}"/>
    </target>

A: 

make sure the javadoc.exe is on your path; this error usually means the ant task cannot find the executable

Aaron Saunders
A: 

javadoc is not in the path. With newer ant you can provide attribute (executable) to specify exe location. See documentation here

Jayan