aspose file tools*
The moose likes Tomcat and the fly likes compilation errors using ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "compilation errors using ant" Watch "compilation errors using ant" New topic
Author

compilation errors using ant

Naiwen Lin
Greenhorn

Joined: Jun 23, 2004
Posts: 3
Hi,

I run ant with several different build.xml and got 100 errors and 78 warnings. The first 2 errors are as follow. I suppose it could be the problem of Java classpath and tried the way described in ant.apache.org documentation, but it still doesn't work. Does anyone know how to get rid of it? Thank you so much.


### I use the sample build.xml from ant.apache.org ###
sample build.xml

### The first 2 errors I got ###
compile:
[javac] Compiling 67 source files to /home/www/semwebjournal/tomcat/webapps/pubserver/WEB-INF/dist/classes
[javac] /home/www/semwebjournal/tomcat/webapps/pubserver/WEB-INF/src/edu/unile/dbs/pubs/main/BibConst.java:17: package com.ms.xml.om does not exist
[javac] import com.ms.xml.om.Document;
[javac] ^
[javac] /home/www/semwebjournal/tomcat/webapps/pubserver/WEB-INF/src/edu/unile/dbs/pubs/main/BibConst.java:18: package com.ms.xml.om does not exist
[javac] import com.ms.xml.om.Element;
[javac] ^
...
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12779
    
    5
The classpath you are handing to the compilation task is incorrect. Probably you have not changed the parts to reflect where the various library files live on your system.
Bill
Naiwen Lin
Greenhorn

Joined: Jun 23, 2004
Posts: 3
Thanks for the answer.

The problem is that I was assigned the code (which is from someone I don't know) and have no idea where package "com.ms.xml.om" is. I guess it is somewhere under "classes" directory, so I do include "src", "classes", "lib" and other possible "lib". Sorry if this is a stupid question.


<path id="project.class.path">
<pathelement location="/usr/local/java/ant/lib/"/>
<pathelement location="/home/www/semwebjournal/tomcat/common/lib/"/>
<pathelement location="${build}" />
<pathelement location="classes/"/>
<pathelement location="src/"/>
<pathelement location="lib/"/>
<fileset dir="/usr/local/java/ant/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="/home/www/semwebjournal/tomcat/common/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="src">
<include name="**/*.java"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>


and compile like this,


<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" debug="true" precation="true">
<classpath refid="project.class.path"/>
</javac>
</target>
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12779
    
    5
Yow - what a nasty problem. "com.ms.xml.om" is not a standard Tomcat or Java package - the com.ms indicates Microsoft. You need to do some more digging into where the code comes from - try looking in the comments of the source code files - especially those that import com.ms.xml.om
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compilation errors using ant