https://issues.apache.org/bugzilla/show_bug.cgi?id=48664
--- Comment #2 from sharmah <[email protected]> 2010-02-03 05:37:19 UTC --- Thanks for the reply Antoine. The output with a --execdebug flag shows that -d64 option is indeed added to the ANT command, but still the JVM launched is 32 bit. Where-as when I pass the same option directly to the "java" command it shows that the JVM launched is 64 bit. Best Regards, Himanshu --execdebug output: Please note in this that the -d64 option is added properly, but the value of "sun.arch.data.model" property remains 32. But, this property expectedly changes to 64, when we use "java -d64" ====== $> ant --execdebug exec "/usr/local/java/jdk/bin/java" -d64 -classpath "/prod/tools/infra/apache/ant-1.7.1/lib/ant-launcher.jar" -Dant.home="/prod/tools/infra/apache/ant-1.7.1" -Dant.library.dir="/prod/tools/infra/apache/ant-1.7.1/lib" org.apache.tools.ant.launch.Launcher -cp "" Buildfile: build.xml compile: run: [java] Value of sun.arch.data.model is 32 BUILD SUCCESSFUL Total time: 0 seconds ======= Here is an illustration of the original problem: ======== $> cat TestProperties.java // Sample java class to test the architecture of the launched JVM. import java.util.Properties; public class TestProperties { public static void main(String[] args) { String testProp = "sun.arch.data.model"; System.out.println("Value of " + testProp + " is " + System.getProperty(testProp)); } } ======== // A sample ant build.xml file, so that we can compile/run // the above test class $> cat build.xml using ANT. <project default="run"> <target name="compile"> <javac srcdir="."/> </target> <target name="run" depends="compile"> <java classname="TestProperties" fork="true"> </java> </target> </project> ======== When I run the class directly using the java command it tells me whether it is running a 32bit JVM or a 64 bit JVM. $> javac TestProperties.java $> java TestProperties Value of sun.arch.data.model is 32 // The launched JVM is 32-bit, which is the default behavior. $> java -d64 TestProperties Value of sun.arch.data.model is 64 // The launched JVM is 64-bit. $> \rm TestProperties.class // Remove that .class file that we compiled manually. Now using ANT, I am not able to reproduce the same: A) $> ant run Buildfile: build.xml compile: run: [java] Value of sun.arch.data.model is 32 // The launched VM is 32 bit, as expected BUILD SUCCESSFUL Total time: 0 seconds $> B) It does not directly accept the -d64 option. C) $> ant -DANT_OPTS="-d64" run ant -DANT_OPTS="-d64" run Buildfile: build.xml compile: run: [java] Value of sun.arch.data.model is 32 // The launched VM is still 32bit. BUILD SUCCESSFUL Total time: 0 seconds D) $> setenv ANT_OPTS "-d64" $> ant run Buildfile: build.xml compile: run: [java] Value of sun.arch.data.model is 32 // The launched VM is still 32bit. BUILD SUCCESSFUL Total time: 0 seconds -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
