Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Ant Java Classpath

Reply
Thread Tools

Ant Java Classpath

 
 
vnssoftware
Guest
Posts: n/a
 
      10-27-2003
Hi,
In build.xml for Ant:
The directory structure that comes from our Application Installer has
jars in several different directories. Can I set CLASSPATH using ; or
, in the Same Tag. Or do I have to use Seperate Tags for each new jar
location directory. I don't want to put all jars in one directory.
That will be a lot of work each time I install a new build.

Thank you!
 
Reply With Quote
 
 
 
 
Wendy S
Guest
Posts: n/a
 
      10-28-2003
vnssoftware wrote:

> Hi,
> The directory structure that comes from our Application Installer has
> jars in several different directories. Can I set CLASSPATH using ; or
> , in the Same Tag. Or do I have to use Seperate Tags for each new jar
> location directory. I don't want to put all jars in one directory.
> That will be a lot of work each time I install a new build.
> Thank you!


Here's one way to do it:

<path id="project.classpath">
<pathelement location="${lib}\optional.jar"/>
<pathelement location="${lib}\struts.jar"/>
<pathelement location="${tomcat}\common\lib\servlet.jar" />
</path>

<target name="compile" depends="init,copy-props">
<javac srcdir="${srcdir}\share" destdir="${destdir}" deprecation="on"
debug="on">
<classpath refid="project.classpath"/>
</javac>
</target>


--
Wendy in Chandler, AZ
 
Reply With Quote
 
 
 
 
vnssoftware
Guest
Posts: n/a
 
      10-28-2003
Can
<pathelement location="${lib}\optional.jar"/>
<pathelement location="${lib}\struts.jar"/>
<pathelement location="${tomcat}\common\lib\servlet.jar" />
be replaced by something like this-

<pathelement location="${lib}\optional.jar,${tomcat}\common\lib \servlet.jar,{someotherdir}\struts.jar"/>

Thanks!
 
Reply With Quote
 
Wendy S
Guest
Posts: n/a
 
      10-28-2003
"vnssoftware" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Can
> <pathelement location="${lib}\optional.jar"/>
> <pathelement location="${lib}\struts.jar"/>
> <pathelement location="${tomcat}\common\lib\servlet.jar" />
> be replaced by something like this-
> <pathelement

location="${lib}\optional.jar,${tomcat}\common\lib \servlet.jar,{someotherdir
}\struts.jar"/>

Go try it and see if it works, or else read the documentation:
http://ant.apache.org/manual/using.html#path

The answer to your question is yes, something LIKE that will work.

--
Wendy in Chandler, AZ


 
Reply With Quote
 
vnssoftware
Guest
Posts: n/a
 
      11-08-2003
Thanks.
If I want to compile just two java files in two different package
directory, how would the javac task look like in the ant script. Can I
do:
c:\...path to dir1\1.java;c:\...path to dir2\2.java
 
Reply With Quote
 
Wendy S
Guest
Posts: n/a
 
      11-09-2003
vnssoftware wrote:

> Thanks.
> If I want to compile just two java files in two different package
> directory, how would the javac task look like in the ant script. Can I
> do:
> c:\...path to dir1\1.java;c:\...path to dir2\2.java


Go read the manual: http://ant.apache.org/manual/

The docs for the 'javac' task give an example of EXACTLY what you're asking:
http://ant.apache.org/manual/CoreTasks/javac.html

--
Wendy in Chandler, AZ
 
Reply With Quote
 
christian Ginouvet
Guest
Posts: n/a
 
      11-09-2003

Bonsoir,
Sous win 98,95, ME
ouvrir la fenetre DOS et taper ECHO si ECHO est actif ouvrir
Open bloc note et open autoexec.bak
pour que le SDK fonctionne inclure la commande SET CLASSPATH le fichier
contenant la bibliotheque java.tools.jar
exemple si le fichier tools.jar se trouve dans le dossier C:\javajdk\lib vous
devez ajouter la ligne suivante: SETCLASSPATH=%CLASSPATH%;.;\javajdk\lib\tools.
jar
--
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr

http://forums.club-internet.fr/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.classpath file instead of the CLASSPATH Environment variable. dontspammenow@yahoo.com Java 2 03-02-2008 08:19 AM
problem compiling project, classpath in xml ".classpath" "<classpathentry...>" jameshanley39@yahoo.co.uk Java 2 03-02-2007 12:37 PM
while using javac -classpath some.jar some.java (Where does classpath get stored?) Gabe Java 3 08-27-2004 07:02 PM
CLASSPATH, -cp and -classpath misunderstanding? Flip Java 3 02-09-2004 10:09 PM
Ant javac : How to print classpath? Ronald Fischer Java 1 09-19-2003 01:13 AM



Advertisments