using ANT_OPTS to affect target java app

I have a 2gig linux 64bit OS. I am using ant 1.7.1 and jdk 1.6_31. I have a simple app that prints that asks for the size of the Maximum java heap and prints it. I am using export ANT_OPTS="-Xmx64M" but when I run my little application with ant target in build.xml, it reports 446Meg.

<target name="askmem">
    <java
        fork="true"
        classname="com.stagirite.test.AskMemory"
        classpathref="project.classpath">

        <classpath path="${build.dir}"/>
    </java>
</target>

I must be doing something wrong? (I discovered from stackoverflow that with this JVM, the default heap is 1/4 total memory, which is what is happening, rather than the value I specified in ANT_OPTS.

Andy

Answers


You're forking the Java anyway, so even if ANT_OPTS did affect the java task, I don't think they'd transfer to it. ANT_OPTS is for ant itself.

If you want to control the JVM used by the forked java task, use nested <jvmargs> elements.


Need Your Help

warnings after updating to x-code 4.4.1 for RestKit

iphone ios xcode restkit

When I updated X-Code to 4.4.1 It gives me 22 warning for using RestKit Library. The error was like this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.