Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Very Bad use of Ant...

Very Bad use of Ant...

2006-08-28       - By Dan McFadyen
Reply:     1     2     3     4     5     6     7     8     9  

Funny, I spoke too soon.

This lovely new forked and running JVM with it's new ant doesn't seem to be
able to find javac to compile... all the environment variables exist on the
outer JVM, but I am rather stumped.

I have failed my attempts to toss the environment variables into the new JVM
using the combination of:

<property environment="env"/>
<env key="JAVA_HOME" value="${env.JAVA_HOME}"/>

I'd be more than happy if someone could point out my mistake.


-----Original Message-----
From: Dan McFadyen [mailto:danm@(protected)]
Sent: Monday, August 28, 2006 3:08 PM
To: Ant Users List
Subject: RE: Very Bad use of Ant...

Hey hey!

I found the stuff I needed after some googling and some of the info from the
first reply, just getting back now and you've made me slightly curious about
what possible side effects would happen without the ant.home as I made it
work without it... Mind you, I am using only to do one small thing so I
might not have noticed it.



-----Original Message-----
From: Darick Jarvis [mailto:djarvis@(protected)]
Sent: Monday, August 28, 2006 2:58 PM
To: 'Ant Users List'
Subject: RE: Very Bad use of Ant...

I don't know if this is the official way to call ant within a java task, but
it works for me.  Maybe this can help you.  This will cause it to outlive
the starting script with no handle to it though.

<java classname=""
    <fileset dir="PATH_TO_ANT_LIBRARY" casesensitive="false">
      <include name="*.jar" />
      <include name="*.zip" />
  <arg value="-f" />
  <arg value="FILE_TO_RUN" />
  <arg value="-Dant.home=PATH_TO_ANT_HOME" />
  <arg value="TARGET_TO_RUN" />

Note, it is important to set the ant.home property for it to run correctly

Hope this helps!

-----Original Message-----
From: Dominique Devienne [mailto:ddevienne@(protected)]
Sent: Monday, August 28, 2006 2:17 PM
To: Ant Users List
Subject: Re: Very Bad use of Ant...

You can always <java fork="true"> the other Ant, and since they live
in different processes and VMs, they can co-exist peacefully. I think
there's an example somewhere that demonstrates how to call Ant using
<java>. --DD

On 8/28/06, Dan McFadyen <danm@(protected)> wrote:
> Hello,
> I am about to ask how to do something that will sound... very very ugly...
> Is there anyway to run a different version of Ant from within an Ant
> I read the faq and found the explantation of the:
>     [exec] java.lang.NoClassDefFoundError:
> org/apache/tools/ant/launch/Launcher
>     [exec] Exception in thread "main"
> I have gone to the 2 different directories I need to run it, and I can run
> each fine (one defined in Env variables, other using absolute path to bin
> dir).
> But... is there any way to not get that?... Or am I stuck with a manual
> if I need 2 versions of Ant to play nice?

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.