ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill.J.Fell...@mail.sprint.com
Subject RE: javadoc ....
Date Fri, 01 Jun 2001 22:11:06 GMT
Conor mentioned a while back about how he never sets global 
environmental variables and I thought it was a good method to go 
through.

The following is what I'd put in a batch command (for now) and execute 
it any time you want to do java.

File dojava.bat:

echo off
set 
CLASSPATH=\jdk1.3\src.jar;\jdk1.3\lib\dt.jar;\jdk1.3\lib\tools.jar;.;\ju
nit3.6\junit.jar;\lib\jaxp.jar;\lib\parser.jar
set JAVA_HOME=c:\jdk1.3\
set PATH=%PATH%;\jdk1.3\bin;.

rem the following is for servlet stuff
set SERVLET_HOME=c:\jakarta\jakarta-servletapi-3.2.2\
set CLASSPATH=%CLASSPATH%;%SERVLET_HOME%lib\servlet.jar

rem the following is for XML stuff
set XML_HOME=c:\somelib\
set CLASSPATH=%CLASSPATH%;%XML_HOME%lib\xmlParser.jar

rem The following is for Struts
set STRUTS_HOME=c:\jakarta\jakarta-struts-1.0-b2\
set CLASSPATH=%CLASSPATH%;%STRUTS_HOME%lib\struts.jar

rem the following is for Ant
set ANT_HOME=c:\jakarta\jakarta-ant-1.3\
set CLASSPATH=%CLASSPATH%;%ANT_HOME%lib\ant.jar
set PATH=%PATH%;\%ANT_HOME%\bin


You can then put a @call statement in ant.bat to invoke the dojava 
before running it.  Someone could probably feed you the syntax on how 
it'd work, I'm rusty on windoze scripting.

A different option, would be to basically do the same except do it like 
this

File my.classpath.txt:
myclasspath=c:\jdk1.3\lib\tools.jar;c:\jakarta\jakarta-ant-1.3\lib\ant.j
ar ....

and then in build.xml
<property file="my.classpath.txt" />

It might take you a bit longer but, I'd do the second option, that way 
you can check the values much easier in ant
<echo message="${myclasspath}" />


To answer your latest question of where your jars at, do the following
c:\> dir /s *.jar > allKnownJars.txt
c:\> dir /s d:\*.jar >> allKnownJars.txt
Then mangle allKnownJars.txt into my.classpath.txt

Anyone who has a cleaner method, feel free to speak up.

I'm outta here for the weekend.  Good luck and enjoy playing around - 
it's the best way to learn.

/bill

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message