ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@stinky.com
Subject [PATCH] add JAXP jars to classpath if possible
Date Fri, 20 Jul 2001 17:04:32 GMT
I just did a clean install of Ant.  I like the concept of having an
executable "ant" installed in $ANT_HOME/bin.  However, it does not
work right out of the box.  It depends on the user having JAXP JARs in
their classpath.  I am a strong believer in not forcing the user to
set their classpath any more than absolutely necessary -- it violates
the "no globals" philosophy of Java.  (I've been burned by conflicting
versions of XML parser libraries many times.  And using jre/lib/ext to
install extensions simply does not work, for some bizarre reason, for
many JARs.)

I'd like to propose that the "ant" script look for an environment
variable called "JAXP_HOME" and, if it's defined, add its "jaxp.jar"
and "crimson.jar" to LOCALCLASSPATH.

Here's a patch.  

Index: ant
===================================================================
RCS file: /home/cvs/jakarta-ant/src/script/ant,v
retrieving revision 1.7
diff -u -r1.7 ant
--- ant	2001/07/07 16:29:49	1.7
+++ ant	2001/07/20 17:10:38
@@ -124,6 +124,12 @@
   fi
 fi
 
+# If JAXP_HOME is defined, then add JAXP JARs (to end of classpath, so
+# users can override with their own CLASSPATH)
+if [ "" != "$JAXP_HOME" ] ; then
+  LOCALCLASSPATH="$LOCALCLASSPATH:$JAXP_HOME/jaxp.jar:$JAXP_HOME/crimson.jar"
+fi
+
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin; then
   ANT_HOME=`cygpath --path --windows "$ANT_HOME"`


I'm not sure if I have committer access to jakarta-ant, but I'd be
happy to try if I get a thumbs up from this list.

-- 
Alex Chaffee                       mailto:alex@jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

Mime
View raw message