Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
import Tidy jar, path to jar

import Tidy jar, path to jar

2005-05-24       - By THUFIR HAWAT
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

I'm not sure how to approach this error, any pointers would be appreciated.

from the console:
[thufir@(protected) java]$
[thufir@(protected) java]$ ant
Buildfile: build.xml

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:38: 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:38: 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: 6 seconds
[thufir@(protected) java]$ cat build.xml
<project name="XHTML" default="package">

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

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

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

       <target name="compile" depends="prepare">
               <javac
                       srcdir          ="${sourceDir}"
                       destdir         ="${outputDir}"
                       classpath       ="${includeJar}"
               />
       </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>
[thufir@(protected) java]$ cat properties.tidy.xml
<project name="properties">
       <property name="outputDir"      value="/home/thufir/java/bin/" />
       <property name="sourceDir"
value="/home/thufir/java/src/atreides/tidyXhtml/" />
       <property name="mainClass"      value="Test16" />
       <property name="pkgPath"        value="atreides.tidyXhtml." />
       <property name="includeJar"
value="/home/thufir/java/src/w3c/tidy/Tidy.jar" />
       <property name="jarPath"        value="atreides.org.w3c.tidy." />
       <property name="jarName"        value="Tidy" />
       <property name="user.name"      value="thufir" />
</project>
[thufir@(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                              "http://www.google.com/
";
       private String outFileName                      = "outFileName.txt";
       private String errOutFileName                   = "errOutFileName.txt";
       private boolean xmlOut                          = true;

       private static String staticURL                 "http://www.google.com/
";
       private static String staticOutFileName         = "outFileName.txt";
       private static String staticErrOutFileName      = "errOutFileName.txt";
       private static boolean staticXMLout             = true;



       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(staticURL, staticOutFileName,
staticErrOutFileName, staticXMLout);
               Thread th1 = new Thread(t1);
               th1.start();
       }//main
}//Test16
[thufir@(protected) java]$




thanks,

Thufir

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.