ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject javac and java -classpath with regards to ant
Date Fri, 04 Feb 2005 10:27:06 GMT
I'm think out loud about ant; I want build.xml to do:

	srcdir		="${sourcedir}"
	destdir		="${destdir}"
	classpath	="${classpath}"
	includes	="${includes}"

inspired by

because that seems to spell out exactly what's sent to
javac.  the properties:

property	value
--------	-----
sourcedir	/java/sources/atreides/jtidy/
destdir		/java/classes/
classpath	/java/sources/org/w3c/tidy/Tidy.jar
includes	/java/sources/org/w3c/tidy/Tidy.jar


"The class path tells the JDK tools and applications
where to find third-party and user-defined classes --
that is, classes that are not extensions or part of the
Java platform. The class path needs to find any classes
you've compiled with the javac compiler -- its default
is the current directory to conveniently enable those
classes to be found,"

so, is in "sourcedir" and imports
org.w3c.tidy.Tidy using Tidy.jar, so the path to
Tidy.jar would be in the classpath.  TidyTest.jar is in
the sourcedir, so doesn't need to be in the classpath.

I'm looking at this snippet, too:

<classpath path="${classpath}"/>

But, don't know what it does, really, but since it
involves classpath it might be useful.

when using "plain" javac from the command line, it's
enough to use the "classfile" switch and give the path to
Tidy.jar like so:

/////////command line///////////////
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>javac @comp

C:\>java -classpath

C:\>type comp
-d C:\java\classes\
-sourcepath C:\java\sources\

And that's what I want ant to do, but I don't quite know
how to put it all together.  Do I include classpath info
in the manifest for the jar which'll be built so that the
jar is clickable?  The Main-Class should read
"atreides.jtidy.TidyTest" indicating where the main class
is, of course.

Since it's necesarry to include the classpath for
package org.w3c.tidy.Tidy to run TidyTest.class it
follows that Tidy.jar and its classpath must also be
included, down the road, in TidyTest.jar.

I hope I'm making at least some sense.  For right now
I'll concentrate on getting ant to compile
so that can be executed with the java command,
then I'll work on packaging it up.  Does that seem a good
way to approach this topic?


Thufir Hawat

Sign-up for Ads Free at

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

View raw message