ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: java task question
Date Tue, 04 Jun 2002 22:26:40 GMT
Your main class name should be dot separated:

You must have the classes in the dir you execute from for it to work on the
command line. --DD

-----Original Message-----
From: Swearingen, David W. [] 
Sent: Tuesday, June 04, 2002 11:45 AM
To: ''
Subject: java task question

I have been able to execute a class from the command line, but unable to do
the same thing from ant using the java task.

The jar file is called htaccess3.jar and resides in directory htaccess3\lib

Here's my jar contents:

     0 Tue Jun 04 12:33:50 EDT 2002 META-INF/
    48 Tue Jun 04 12:33:50 EDT 2002 META-INF/MANIFEST.MF
  1037 Tue Jun 04 12:33:50 EDT 2002 mil/army/ctis/mapserver/maintest.class
  1469 Tue Jun 04 12:33:50 EDT 2002
   337 Tue Jun 04 12:33:50 EDT 2002 mil/army/ctis/mapserver/right.class
  1472 Tue Jun 04 12:33:50 EDT 2002 mil/army/ctis/mapserver/user.class

The class I want to execute is maintest.class

I can sit at command line in directory htaccess3 and successfully execute
maintest by running:

java -cp lib\htaccess3.jar mil/army/ctis/mapserver/maintest

However, when I try to put the java task in my build.xml file, it doesn't
work.  This is what I've tried:

<target name="run" depends="dist">
	<java classpath="lib/htaccess3.jar"
classname="mil/army/ctis/mapserver/maintest" />

where the basedir is the htaccess3 directory.

The ant error is: "Could not find mil\army\ctis\mapserver\maintest. Make
sure you have it in your classpath"

What am I doing wrong?  I think I've tried every conceivable permutation of
directory reference, class reference, etc.


David Swearingen
Northrop-Grumman Information Technology - TASC
4801 Stonecroft Blvd.  Chantilly, VA 20151-3822
703-633-8300 x4790 voice
703-449-1610 fax

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message