I think the compile target is causing the errors...?

from the terminal:

[EMAIL PROTECTED] java]$ cat build.xml
<project name="tidy" default="package">

      <import file="tidyBuild/properties.xml" />

      <target name="clean">
              <delete dir="${outputDir}" />
      </target>

      <target name="prepare" depends="clean">
              <mkdir dir="${outputDir}" />
      </target>

      <echo message="classpath=${cp}" />

      <target name="compile" depends="prepare">
              <javac
                      srcdir          ="${sourceDir}"
                      destdir         ="${outputDir}">
                      <classpath>
                              <pathelement location="${tidy.path}" />
                      </classpath>
              </javac>
      </target>

      <target name="package" depends="compile">
              <jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}"
>
                      <manifest>
                              <attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
                      </manifest>
              </jar>
      </target>

</project>
[EMAIL PROTECTED] java]$ cat tidyBuild/properties.xml
<project name="properties" basedir=".">
      <property name="outputDir"      value="bin/" />
      <property name="sourceDir"      value="src/atreides/tidyXhtml/" />
      <property name="mainClass"      value="Test16" />
      <property name="pkgPath"        value="atreides.tidyXhtml." />
      <property name="user.name"      value="thufir" />
      <property name="cp"             refid="tidy.path" />

      <path id="tidy.path">
              <pathelement location="lib/Tidy.jar" />
      </path>
</project>
[EMAIL PROTECTED] java]$ cat src/atreides/tidyXhtml/Test16.java
package atreides.tidyXhtml;

import java.io.IOException;
import java.net.URL;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileWriter;
import org.w3c.tidy.Tidy;


public class Test16 implements Runnable {

      private String url;
      private String outFileName;
      private String errOutFileName;
      private boolean xmlOut;

      public Test16(String url, String outFileName,String
errOutFileName, boolean
xmlOut){
              this.url = url;
              this.outFileName = outFileName;
              this.errOutFileName = errOutFileName;
              this.xmlOut = xmlOut;
      }//Test16

      public void run() {
              URL u;
              BufferedInputStream in;
              FileOutputStream out;
              Tidy tidy = new Tidy();

              tidy.setXmlOut(xmlOut);
              try {
                      tidy.setErrout(new PrintWriter(new
FileWriter(errOutFileName), true));
                      u = new URL(url);
                      in = new BufferedInputStream(u.openStream());
                      out = new FileOutputStream(outFileName);
                      tidy.parse(in, out);
              }//try
              catch ( IOException e ) {
              System.out.println( this.toString() + e.toString() );
              }//catch
      }//run

      public static void main( String[] args ) {
      Test16 t1 = new Test16(args[0], args[1], args[2], true);
      Test16 t2 = new Test16(args[3], args[4], args[5], false);
      Thread th1 = new Thread(t1);
      Thread th2 = new Thread(t2);

      th1.start();
      th2.start();
      }//main
}//Test16
[EMAIL PROTECTED] java]$
[EMAIL PROTECTED] java]$ ant
Buildfile: build.xml
Overriding previous definition of reference to tidy.path
   [echo] classpath=/home/thufir/java/lib/Tidy.jar

clean:
 [delete] Deleting directory /home/thufir/java/bin

prepare:
  [mkdir] Created dir: /home/thufir/java/bin

compile:
  [javac] Compiling 1 source file to /home/thufir/java/bin
  [javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:9: package
org.w3c.tidy does not exist
  [javac] import org.w3c.tidy.Tidy;
  [javac]                     ^
  [javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:30: cannot find
symbol
  [javac] symbol  : class Tidy
  [javac] location: class atreides.tidyXhtml.Test16
  [javac]             Tidy tidy = new Tidy();
  [javac]                 ^
  [javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:30: cannot find
symbol
  [javac] symbol  : class Tidy
  [javac] location: class atreides.tidyXhtml.Test16
  [javac]             Tidy tidy = new Tidy();
  [javac]                                 ^
  [javac] 3 errors

BUILD FAILED
/home/thufir/java/build.xml:18: Compile failed; see the compiler error
output for
details.

Total time: 5 seconds
[EMAIL PROTECTED] java]$



thanks,

Thufir


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to