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-27       - By THUFIR HAWAT
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

I did a bit of googling, and per <http://www.jguru.com/faq/view.jsp?EIDG1917>
put an echo statement in there.  I'm working on adding more
echo statements to debug this.  here's where I'm currently at:


[thufir@(protected) java]$ pwd
/home/thufir/java
[thufir@(protected) java]$ cat argFile.txt
src/atreides/tidyXhtml/Test16.java
-d bin
-classpath lib/Tidy.jar
[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       ="${location}"
               />
       </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="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="tools.class.path" />

       <path id="tools.class.path">
               <pathelement path="src/org/w3c/tidy/Tidy.jar" />
       </path>

       <echo message="classpath=${cp}" />
</project>
[thufir@(protected) java]$ javac @(protected)
javac: file not found: arfFile.txt (No such file or directory)
[thufir@(protected) java]$ javac @(protected)
[thufir@(protected) java]$ echo "compile works"
compile works
[thufir@(protected) java]$ ant -v -d
Apache Ant version 1.6.4 compiled on May 19 2005
Apache Ant version 1.6.4 compiled on May 19 2005
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.5 in: /usr/java/jdk1.5.0_02/jre
Detected OS: Linux
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.4 compiled on
May 19 2005
Setting ro project property: ant.file -> /home/thufir/java/build.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /home/thufir/java/build.xml with URI file:///home/thufir/java
/build.xmlSetting ro project property:
ant.project.name ->
XHTML
Adding reference: XHTML
Setting ro project property: ant.file.XHTML -> /home/thufir/java/build.xml
Project base dir set to: /home/thufir/java
+Target:
+Target: clean
+Target: prepare
+Target: compile
+Target: package
Importing file properties.tidy.xml from /home/thufir/java/build.xml
parsing buildfile /home/thufir/java/properties.tidy.xml with URI file:///home
/thufir/java/properties.tidy.xml
Setting ro project property: ant.file.properties ->
/home/thufir/java/properties.tidy.xml
Adding reference: tools.class.path
Setting project property: outputDir -> bin/
Setting project property: sourceDir -> src/atreides/tidyXhtml/
Setting project property: mainClass -> Test16
Setting project property: pkgPath -> atreides.tidyXhtml.
Override ignored for property user.name
Could not load a dependent class
(com/sun/media/jai/codec/FileSeekableStream) for
type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Adding reference: tools.class.path
Setting project property: cp -> /home/thufir/java/src/org/w3c/tidy/Tidy.jar
Could not load a dependent class
(com/sun/media/jai/codec/FileSeekableStream) for
type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Overriding previous definition of reference to tools.class.path
Adding reference: tools.class.path
    [echo] classpath=/home/thufir/java/src/org/w3c/tidy/Tidy.jar
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `package' is [clean, prepare, compile, package]
Complete build sequence is [clean, prepare, compile, package, ]

clean:
  [delete] Deleting directory /home/thufir/java/bin
  [delete] Deleting /home/thufir/java/bin/atreides/xhtml/Test16.class
  [delete] Deleting directory /home/thufir/java/bin/atreides/xhtml
  [delete] Deleting directory /home/thufir/java/bin/atreides
  [delete] Deleting directory /home/thufir/java/bin

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

compile:
Property ${location} has not been set
Could not load a dependent class
(com/sun/media/jai/codec/FileSeekableStream) for
type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (junit/framework/Test) for type junit
fileset: Setup scanner in dir /home/thufir/java/src/atreides/tidyXhtml with
patternSet{ includes: [] excludes: [] }
   [javac] Test16.java added as Test16.class doesn't exist.
   [javac] Test16.java.1 skipped - don't know how to handle it
   [javac] Test16.java.2 skipped - don't know how to handle it
   [javac] Test16.java.3 skipped - don't know how to handle it
   [javac] Test16.java.4 skipped - don't know how to handle it
   [javac] Test16.java.5 skipped - don't know how to handle it
   [javac] Test16.java.6 skipped - don't know how to handle it
   [javac] Compiling 1 source file to /home/thufir/java/bin
   [javac] Using modern compiler
dropping /home/thufir/java/${location} from path as it doesn't exist
   [javac] Compilation arguments:
   [javac] '-d'
   [javac] '/home/thufir/java/bin'
   [javac] '-classpath'
   [javac]
'/home/thufir/java/bin:/usr/local/ant/lib/ant-launcher.jar:/usr/local/ant/lib
/ant-nodeps.jar:/usr/local/ant/lib/ant-apache-regexp.jar:/usr/local/ant/lib/ant
-jmf.jar:/usr/local/ant/lib/ant-icontract.jar:/usr/local/ant/lib/ant-junit.jar:
/usr/local/ant/lib/ant-commons-net.jar:/usr/local/ant/lib/ant-xslp.jar:/usr
/local/ant/lib/ant-apache-resolver.jar:/usr/local/ant/lib/ant-trax.jar:/usr
/local/ant/lib/ant-apache-log4j.jar:/usr/local/ant/lib/ant-jdepend.jar:/usr
/local/ant/lib/xercesImpl.jar:/usr/local/ant/lib/ant-antlr.jar:/usr/local/ant
/lib/xml-apis.jar:/usr/local/ant/lib/ant-starteam.jar:/usr/local/ant/lib/ant-jai
.jar:/usr/local/ant/lib/ant-commons-logging.jar:/usr/local/ant/lib/ant.jar:/usr
/local/ant/lib/ant-apache-oro.jar:/usr/local/ant/lib/ant-apache-bsf.jar:/usr
/local/ant/lib/ant-vaj.jar:/usr/local/ant/lib/ant-javamail.jar:/usr/local/ant
/lib/ant-swing.jar:/usr/local/ant/lib/ant-jsch.jar:/usr/local/ant/lib/ant-apache
-bcel.jar:/usr/local/ant/lib/ant-weblogic.jar:/usr/local/ant/lib/ant-netrexx.jar
:/usr/local/ant/lib/ant-xalan1.jar:/usr/local/ant/lib/ant-stylebook.jar:/usr
/java/jdk1.5.0_02/lib/tools.jar'
   [javac] '-sourcepath'
   [javac] '/home/thufir/java/src/atreides/tidyXhtml'
   [javac] '-g:none'
   [javac]
   [javac] The ' characters around the executable and arguments are
   [javac] not part of the command.
   [javac] File to be compiled:
   [javac]     /home/thufir/java/src/atreides/tidyXhtml/Test16.java
   [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:42: cannot find
symbol
   [javac] symbol  : class Tidy
   [javac] location: class atreides.xhtml.Test16
   [javac]        Tidy tidy = new Tidy();
   [javac]        ^
   [javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:42: cannot find
symbol
   [javac] symbol  : class Tidy
   [javac] location: class atreides.xhtml.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.
       at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
       at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       at org.apache.tools.ant.Target.execute(Target.java:341)
       at org.apache.tools.ant.Target.performTasks(Target.java:369)
       at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
       at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
       at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java
:40)
       at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
       at org.apache.tools.ant.Main.runBuild(Main.java:668)
       at org.apache.tools.ant.Main.startAnt(Main.java:187)
       at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
       at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 6 seconds
[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.