Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

compilation errors using ant

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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] ^
...
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
knowledge is the difference between drudgery and strategic action -- tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic