From ant-dev-return-12120-apmail-jakarta-ant-dev-archive=jakarta.apache.org@jakarta.apache.org Tue Mar 27 20:52:16 2001 Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@jakarta.apache.org Received: (qmail 66424 invoked by uid 500); 27 Mar 2001 20:52:15 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: ant-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list ant-dev@jakarta.apache.org Delivered-To: moderator for ant-dev@jakarta.apache.org Received: (qmail 42157 invoked from network); 27 Mar 2001 19:09:16 -0000 Message-ID: From: "STEARNS,JIM (HP-FtCollins,ex1)" To: "'Peter Donald'" , ant-dev@jakarta.apache.org Cc: "STEARNS,JIM (HP-FtCollins,ex1)" Subject: RE: [Bug 1126] New - bin\lcp.bat prepends Ant libraries to user' s path Date: Tue, 27 Mar 2001 12:09:14 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Pete, Thanks for your response. > It is highly recomended that you NEVER in any circumstances > have multiple > implementations of any library sitting in classpath. Excuse me, but there was only one DOM parser in the classpath that *I* defined. Ant, under the covers, prepends a classpath containing a reference to Crimson. Ant caused the multiple reference problem. > >To fix this you can > >simply delete crimson/jaxp and replace with another compiler > (ie xerces). What's simple for an Ant expert is a little more challenging to a novice Ant user. Examine what's necessary to "simply delete crimson": 1. A novice's build of an application using a DOM Level 2 parser fails with unknown namespace-related methods. What gives: %CLASSPATH% looks good!? 2. Novice adds to his build.xml to see what Ant thinks is the classpath, and discovers that classpath now includes, at the beginning, references to jar files in %ANT_HOME%\lib. Now where is that being done? 3. (This novice took extra step of downloading ant source, which proved not to be necessary). 4. Look at bin\ant.bat. Oh, in :checkJava, lcp.bat is called to modify %LOCALCLASSPATH%. 5. Aha - lcp.bat prepends! OK, I grant you that after Step 2, deleting ant\lib\parser.java would have been the smart move, a little less intrusive than modifying bin\lcp.bat. But I'll have to remember to do that deletion every time I update ant binaries. I suggest the current lcp.bat introduces a trap for the uninitiated, and urge you to consider a solution to the empty classpath problem for ant builds that does not have such a significant side-effect. Here's a possible alternative solution for lcp.bat that may address both of our concerns: if "%LOCALCLASSPATH%" == "" goto appendPath set LOCALCLASSPATH=%LOCALCLASSPATH%; :appendPath set LOCALCLASSPATH=%LOCALCLASSPATH%%1% Thanks, Jim Stearns > -----Original Message----- > From: Peter Donald [mailto:donaldp@apache.org] > Sent: Monday, March 26, 2001 6:42 PM > To: ant-dev@jakarta.apache.org > Cc: jim_stearns@hp.com > Subject: Re: [Bug 1126] New - bin\lcp.bat prepends Ant libraries to > user's path > > > At 12:40 27/3/01 +1000, Peter Donald wrote: > >At 06:11 26/3/01 -0800, bugzilla@apache.org wrote: > >>+ This problem is restricted to version 1.3; version 1.2 > correctly appends > >rather > >>+ than prepends. I'm curious how the defect was introduced. > > > >because it fixed another defect. Before Ant 1.3 you could > not build ant out > >of the box because an empty CLASSPATH entry (if CLASSPATH > was undefined) > >would cause build process to fail. > > > >It is highly recomended that you NEVER in any circumstances > have multiple > >implementations of ant library sitting in classpath. > > That should of course read > > It is highly recomended that you NEVER in any circumstances > have multiple > implementations of any library sitting in classpath. > > > >To fix this you can > >simply delete crimson/jaxp and replace with another compiler > (ie xerces). > > Cheers, > > Pete > > *-----------------------------------------------------* > | "Faced with the choice between changing one's mind, | > | and proving that there is no need to do so - almost | > | everyone gets busy on the proof." | > | - John Kenneth Galbraith | > *-----------------------------------------------------* >