Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


pathelement with javac

From: "hawat.thufir@-----.---" <-----.------@-----.--->
To: NULL
Date: 6/1/2005 10:24:00 AM
I think the compile target is causing the errors...?

from the terminal:

[thufir@localhost 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>
[thufir@localhost 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>
[thufir@localhost 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
[thufir@localhost java]$
[thufir@localhost 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
[thufir@localhost java]$



thanks,

Thufir



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent