You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/09/22 22:06:53 UTC

FW: Problem with Ant Integration (and workaround)

Forwarding to the cactus list. Actually Chris know more than I do on
this subject... :-)

Thanks
-Vincent

> -----Original Message-----
> From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> Sent: 22 September 2003 14:03
> To: Vincent Massol
> Subject: Re: Problem with Ant Integration (and workaround)
> 
> Vincent,  I was looking at the AbstractCatalinaContainer and I was
> wondering
> if the "cactus" task is not forking is it necessary for the tools.jar
to
> be
> added to the classpath if it already is on the classpath?  It seems
like
> if
> the task is not forking that you could just do use
> Class.forName("com.sun.tools.javac.Main") to check if javac was
available.
> Otherwise, I am sure we can come up with a simple case to handle the
JRE
> case with Eclipse.  My main thing is it seems like that if a developer
> adds
> the tools.jar to his Ant runtime then the thought goes with Cactus
"well,
> it
> added to my classpath for Ant -- it should be picking it up!"
> 
> Your thoughts?
> 
> ----- Original Message -----
> From: "Vincent Massol" <vm...@pivolis.com>
> To: "'Bill Siggelkow'" <bi...@bellsouth.net>
> Sent: Sunday, September 21, 2003 11:06 AM
> Subject: RE: Problem with Ant Integration (and workaround)
> 
> 
> >
> >
> > > -----Original Message-----
> > > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > > Sent: 21 September 2003 16:57
> > > To: Cactus Users List
> > > Subject: Re: Problem with Ant Integration (and workaround)
> > >
> > > Thanks for the info, Vincent.  The "javac" task works for me under
> > Eclipse
> > > because I have included the tools.jar in the Ant runtime classpath
> > > (Window->Preferences->Ant->Runtime) so the javac task must be
using a
> > > different mechanism to locate the tools.jar.  I will try and find
the
> > time
> > > to take investigate this and submit a patch -- right now my
3-year-old
> > > wants
> > > to color -- priorities :)
> >
> > hehe. I can understand that. I have 2 kids myself (3 and 5 years
old).
> >
> > Thanks
> > -Vincent
> >
> > >
> > > ----- Original Message -----
> > > From: "Vincent Massol" <vm...@pivolis.com>
> > > To: "'Cactus Users List'" <ca...@jakarta.apache.org>
> > > Cc: "'Bill Siggelkow'" <bi...@bellsouth.net>
> > > Sent: Sunday, September 21, 2003 2:13 AM
> > > Subject: RE: Problem with Ant Integration (and workaround)
> > >
> > >
> > > > Hi Bill
> > > >
> > > > This is a known problem in Eclipse :-) It's the same if you use
the
> > > > <javac> task in Ant. It will fail under default Eclipse.
Because, by
> > > > default Eclipse configures the JRE and not the JDK. I heard
they're
> > > > going to change something in future versions.
> > > >
> > > > That said, you're right, we should definitely improve the
> > getToolsJar.
> > > > We'd be happy to get a patch if you have some time...
> > > >
> > > > Thanks
> > > > -Vincent
> > > >
> > > > > -----Original Message-----
> > > > > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > > > > Sent: 21 September 2003 02:25
> > > > > To: cactus-user@jakarta.apache.org
> > > > > Subject: Problem with Ant Integration (and workaround)
> > > > >
> > > > > I recently had a wierd problem with the Cactus-Ant
Integration.  I
> > am
> > > > > using
> > > > > the 1.6dev-20030907 ant integration jar.  Anyway, the problem
I
> > had
> > > > was
> > > > > with
> > > > > the "cactus" task (attempting to start Tomcat).  When I ran
the
> > Ant
> > > > script
> > > > > from within Eclipse it failed with the error "Couldn't find
> > tools.jar
> > > > > ...".
> > > > > However, when I ran the script from the command-line it worked
> > fine.
> > > > I
> > > > > traced the problem down to the getToolsJar method of the
> > > > > AbstractJavaContainer class.  Basically, what this method does
is
> > try
> > > > to
> > > > > locate the "tools.jar" in the following location:
> > > > >
> > > > > [java.home]/../lib/tools.jar
> > > > >
> > > > > This works fine if "java.home" is pointing to something like
> > > > > C:\j2dsk1.4.2\jre ... However when running in Eclipse my
> > "java.home"
> > > > was
> > > > > C:\Program Files\Java\jre -- and, consequently, the tools.jar
> > couldn't
> > > > be
> > > > > found.  My quick-and-dirty workaround was to create the
following
> > a
> > > > 'lib'
> > > > > folder under C:\Program Files\Java and copy the tools.jar
there.
> > It
> > > > seems
> > > > > like the getToolsJar method could be made a little smarter to
> > handle
> > > > this
> > > > > situation.
> > > > >
> > > > >
> > > > >
> >
---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
cactus-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> > cactus-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
cactus-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
cactus-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
cactus-user-help@jakarta.apache.org
> >
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


RE: Problem with Ant Integration (and workaround)

Posted by Vincent Massol <vm...@pivolis.com>.
Bill,

I would need to look at the code but I guess there's a good reason for
forking (if only to make it clean!). So I wouldn't quite agree not to
fork simply to add the tools.jar to the CP. 

What the user needs to do is to use a JDK not a JRE! That's all. If you
configure Eclipse to use your JDK instead of your JRE, it should work
fine I guess.

Thanks
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: 22 September 2003 22:07
> To: 'Cactus Developers List'
> Cc: billsigg@bellsouth.net
> Subject: FW: Problem with Ant Integration (and workaround)
> 
> Forwarding to the cactus list. Actually Chris know more than I do on
> this subject... :-)
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > Sent: 22 September 2003 14:03
> > To: Vincent Massol
> > Subject: Re: Problem with Ant Integration (and workaround)
> >
> > Vincent,  I was looking at the AbstractCatalinaContainer and I was
> > wondering
> > if the "cactus" task is not forking is it necessary for the
tools.jar
> to
> > be
> > added to the classpath if it already is on the classpath?  It seems
> like
> > if
> > the task is not forking that you could just do use
> > Class.forName("com.sun.tools.javac.Main") to check if javac was
> available.
> > Otherwise, I am sure we can come up with a simple case to handle the
> JRE
> > case with Eclipse.  My main thing is it seems like that if a
developer
> > adds
> > the tools.jar to his Ant runtime then the thought goes with Cactus
> "well,
> > it
> > added to my classpath for Ant -- it should be picking it up!"
> >
> > Your thoughts?
> >
> > ----- Original Message -----
> > From: "Vincent Massol" <vm...@pivolis.com>
> > To: "'Bill Siggelkow'" <bi...@bellsouth.net>
> > Sent: Sunday, September 21, 2003 11:06 AM
> > Subject: RE: Problem with Ant Integration (and workaround)
> >
> >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > > > Sent: 21 September 2003 16:57
> > > > To: Cactus Users List
> > > > Subject: Re: Problem with Ant Integration (and workaround)
> > > >
> > > > Thanks for the info, Vincent.  The "javac" task works for me
under
> > > Eclipse
> > > > because I have included the tools.jar in the Ant runtime
classpath
> > > > (Window->Preferences->Ant->Runtime) so the javac task must be
> using a
> > > > different mechanism to locate the tools.jar.  I will try and
find
> the
> > > time
> > > > to take investigate this and submit a patch -- right now my
> 3-year-old
> > > > wants
> > > > to color -- priorities :)
> > >
> > > hehe. I can understand that. I have 2 kids myself (3 and 5 years
> old).
> > >
> > > Thanks
> > > -Vincent
> > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Vincent Massol" <vm...@pivolis.com>
> > > > To: "'Cactus Users List'" <ca...@jakarta.apache.org>
> > > > Cc: "'Bill Siggelkow'" <bi...@bellsouth.net>
> > > > Sent: Sunday, September 21, 2003 2:13 AM
> > > > Subject: RE: Problem with Ant Integration (and workaround)
> > > >
> > > >
> > > > > Hi Bill
> > > > >
> > > > > This is a known problem in Eclipse :-) It's the same if you
use
> the
> > > > > <javac> task in Ant. It will fail under default Eclipse.
> Because, by
> > > > > default Eclipse configures the JRE and not the JDK. I heard
> they're
> > > > > going to change something in future versions.
> > > > >
> > > > > That said, you're right, we should definitely improve the
> > > getToolsJar.
> > > > > We'd be happy to get a patch if you have some time...
> > > > >
> > > > > Thanks
> > > > > -Vincent
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > > > > > Sent: 21 September 2003 02:25
> > > > > > To: cactus-user@jakarta.apache.org
> > > > > > Subject: Problem with Ant Integration (and workaround)
> > > > > >
> > > > > > I recently had a wierd problem with the Cactus-Ant
> Integration.  I
> > > am
> > > > > > using
> > > > > > the 1.6dev-20030907 ant integration jar.  Anyway, the
problem
> I
> > > had
> > > > > was
> > > > > > with
> > > > > > the "cactus" task (attempting to start Tomcat).  When I ran
> the
> > > Ant
> > > > > script
> > > > > > from within Eclipse it failed with the error "Couldn't find
> > > tools.jar
> > > > > > ...".
> > > > > > However, when I ran the script from the command-line it
worked
> > > fine.
> > > > > I
> > > > > > traced the problem down to the getToolsJar method of the
> > > > > > AbstractJavaContainer class.  Basically, what this method
does
> is
> > > try
> > > > > to
> > > > > > locate the "tools.jar" in the following location:
> > > > > >
> > > > > > [java.home]/../lib/tools.jar
> > > > > >
> > > > > > This works fine if "java.home" is pointing to something like
> > > > > > C:\j2dsk1.4.2\jre ... However when running in Eclipse my
> > > "java.home"
> > > > > was
> > > > > > C:\Program Files\Java\jre -- and, consequently, the
tools.jar
> > > couldn't
> > > > > be
> > > > > > found.  My quick-and-dirty workaround was to create the
> following
> > > a
> > > > > 'lib'
> > > > > > folder under C:\Program Files\Java and copy the tools.jar
> there.
> > > It
> > > > > seems
> > > > > > like the getToolsJar method could be made a little smarter
to
> > > handle
> > > > > this
> > > > > > situation.
> > > > > >
> > > > > >
> > > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > > > > > For additional commands, e-mail:
> > > cactus-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
cactus-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> > >
> > >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


RE: Problem with Ant Integration (and workaround)

Posted by Vincent Massol <vm...@pivolis.com>.
Bill,

I would need to look at the code but I guess there's a good reason for
forking (if only to make it clean!). So I wouldn't quite agree not to
fork simply to add the tools.jar to the CP. 

What the user needs to do is to use a JDK not a JRE! That's all. If you
configure Eclipse to use your JDK instead of your JRE, it should work
fine I guess.

Thanks
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: 22 September 2003 22:07
> To: 'Cactus Developers List'
> Cc: billsigg@bellsouth.net
> Subject: FW: Problem with Ant Integration (and workaround)
> 
> Forwarding to the cactus list. Actually Chris know more than I do on
> this subject... :-)
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > Sent: 22 September 2003 14:03
> > To: Vincent Massol
> > Subject: Re: Problem with Ant Integration (and workaround)
> >
> > Vincent,  I was looking at the AbstractCatalinaContainer and I was
> > wondering
> > if the "cactus" task is not forking is it necessary for the
tools.jar
> to
> > be
> > added to the classpath if it already is on the classpath?  It seems
> like
> > if
> > the task is not forking that you could just do use
> > Class.forName("com.sun.tools.javac.Main") to check if javac was
> available.
> > Otherwise, I am sure we can come up with a simple case to handle the
> JRE
> > case with Eclipse.  My main thing is it seems like that if a
developer
> > adds
> > the tools.jar to his Ant runtime then the thought goes with Cactus
> "well,
> > it
> > added to my classpath for Ant -- it should be picking it up!"
> >
> > Your thoughts?
> >
> > ----- Original Message -----
> > From: "Vincent Massol" <vm...@pivolis.com>
> > To: "'Bill Siggelkow'" <bi...@bellsouth.net>
> > Sent: Sunday, September 21, 2003 11:06 AM
> > Subject: RE: Problem with Ant Integration (and workaround)
> >
> >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > > > Sent: 21 September 2003 16:57
> > > > To: Cactus Users List
> > > > Subject: Re: Problem with Ant Integration (and workaround)
> > > >
> > > > Thanks for the info, Vincent.  The "javac" task works for me
under
> > > Eclipse
> > > > because I have included the tools.jar in the Ant runtime
classpath
> > > > (Window->Preferences->Ant->Runtime) so the javac task must be
> using a
> > > > different mechanism to locate the tools.jar.  I will try and
find
> the
> > > time
> > > > to take investigate this and submit a patch -- right now my
> 3-year-old
> > > > wants
> > > > to color -- priorities :)
> > >
> > > hehe. I can understand that. I have 2 kids myself (3 and 5 years
> old).
> > >
> > > Thanks
> > > -Vincent
> > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Vincent Massol" <vm...@pivolis.com>
> > > > To: "'Cactus Users List'" <ca...@jakarta.apache.org>
> > > > Cc: "'Bill Siggelkow'" <bi...@bellsouth.net>
> > > > Sent: Sunday, September 21, 2003 2:13 AM
> > > > Subject: RE: Problem with Ant Integration (and workaround)
> > > >
> > > >
> > > > > Hi Bill
> > > > >
> > > > > This is a known problem in Eclipse :-) It's the same if you
use
> the
> > > > > <javac> task in Ant. It will fail under default Eclipse.
> Because, by
> > > > > default Eclipse configures the JRE and not the JDK. I heard
> they're
> > > > > going to change something in future versions.
> > > > >
> > > > > That said, you're right, we should definitely improve the
> > > getToolsJar.
> > > > > We'd be happy to get a patch if you have some time...
> > > > >
> > > > > Thanks
> > > > > -Vincent
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> > > > > > Sent: 21 September 2003 02:25
> > > > > > To: cactus-user@jakarta.apache.org
> > > > > > Subject: Problem with Ant Integration (and workaround)
> > > > > >
> > > > > > I recently had a wierd problem with the Cactus-Ant
> Integration.  I
> > > am
> > > > > > using
> > > > > > the 1.6dev-20030907 ant integration jar.  Anyway, the
problem
> I
> > > had
> > > > > was
> > > > > > with
> > > > > > the "cactus" task (attempting to start Tomcat).  When I ran
> the
> > > Ant
> > > > > script
> > > > > > from within Eclipse it failed with the error "Couldn't find
> > > tools.jar
> > > > > > ...".
> > > > > > However, when I ran the script from the command-line it
worked
> > > fine.
> > > > > I
> > > > > > traced the problem down to the getToolsJar method of the
> > > > > > AbstractJavaContainer class.  Basically, what this method
does
> is
> > > try
> > > > > to
> > > > > > locate the "tools.jar" in the following location:
> > > > > >
> > > > > > [java.home]/../lib/tools.jar
> > > > > >
> > > > > > This works fine if "java.home" is pointing to something like
> > > > > > C:\j2dsk1.4.2\jre ... However when running in Eclipse my
> > > "java.home"
> > > > > was
> > > > > > C:\Program Files\Java\jre -- and, consequently, the
tools.jar
> > > couldn't
> > > > > be
> > > > > > found.  My quick-and-dirty workaround was to create the
> following
> > > a
> > > > > 'lib'
> > > > > > folder under C:\Program Files\Java and copy the tools.jar
> there.
> > > It
> > > > > seems
> > > > > > like the getToolsJar method could be made a little smarter
to
> > > handle
> > > > > this
> > > > > > situation.
> > > > > >
> > > > > >
> > > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > > > > > For additional commands, e-mail:
> > > cactus-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
cactus-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> > >
> > >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-dev-help@jakarta.apache.org