You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nisha Pillai <np...@teja.com> on 2003/05/02 02:16:23 UTC

Re: -J option task question

Since I haven't heard anything further, let me rephrase the question. Is 
there anything I need to do (outside of the invocation of the task, for 
example) in order to ensure that fork works in the javac task?
- Nisha.

Nisha Pillai wrote:

> Stefan Bodewig wrote:
>
>> On Tue, 29 Apr 2003, Nisha Pillai <np...@teja.com> wrote:
>>
>>  
>>
>>>   Thanks for your input. This worked.
>>>   
>>
>>
>> Strange, as it shouldn't work.  If setting ANT_OPTS solves your issue,
>> then you are not forking javac.  The maxmemory attribute will only
>> apply if you set fork to true.
>>
>> If you don't fork, javac will run in the same Java VM instance that is
>> running Ant and your only option is to increase the memory size for
>> this VM - which in turn can only be done before Ant has been started
>> (via ANT_OPTS or ~/.antrc).
>>
>> Stefan
>>  
>>
> Stefan,
>    I understand that maxmemory will only work with fork. Per the 
> snippet I included in my original post, I am setting fork=yes in my 
> javac task. And before someone says to try fork=true, I've tried that 
> as well. Anyways, here is the javac part from my buildfile again.
>
>  <target name="compile" depends="init" description="compile the source 
> " >
>    <!-- Compile the java code from ${src} into ${build} -->
>    <javac srcdir="${src}" destdir="${build}" debug="on" fork="yes" 
> memoryMaximumSize="128m">
>      <classpath>
>      <fileset dir="${maindir}/external_jars" includes="**/*.jar"/>
>      <pathelement path="${java.class.path}/"/>
>      </classpath>
>    </javac>
>  </target>
>
> Realized when I saw ANT_OPTS working that fork wasn't working, but I'm 
> not sure why. Anyone?
> And no, I'm not setting the build.compiler property.
> - Nisha.




Re: -J option task question

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 01 May 2003, Nisha Pillai <np...@teja.com> wrote:

> Since I haven't heard anything further,

May 1st is a holiday in my part of the world, sorry.

Stefan

Re: -J option task question

Posted by Jesse Stockall <st...@magma.ca>.
On Thu, 2003-05-01 at 20:16, Nisha Pillai wrote:
> Since I haven't heard anything further, let me rephrase the question. Is 
> there anything I need to do (outside of the invocation of the task, for 
> example) in order to ensure that fork works in the javac task?

If you set 'fork=true' (or 'yes' or 'on') then <javac> will be executed
in a separate VM. 

If you run ant with '-debug' you will see the exact command line being
used to invoke the forked VM.

-- 
Jesse Stockall <st...@magma.ca>