I am running ant 1.4.1 on solaris 2.8
my question is about the javac task.
the resulting class files generated are different when using the ant [javac]
task vs. the command line javac.
one class file size is 234 bytes and the other 309.
why would this be?
i have a very simple class called Test.java and here is my build.xml:
<project name="POC" default="all" basedir=".">
<target name="ant" depends="" >
<exec executable="which">
<arg line="javac" />
</exec>
<javac srcdir="." destdir="." verbose="true"/>
<exec executable="javap">
<arg line=" -classpath . Test" />
</exec>
<exec executable="ls">
<arg line="-l Test.class" />
</exec>
</target>
<target name="javac" depends="" >
<exec executable="which">
<arg line="javac" />
</exec>
<exec executable="javac">
<arg line=" -verbose ./Test.java" />
</exec>
<exec executable="javap">
<arg line=" -classpath . Test" />
</exec>
<exec executable="ls">
<arg line="-l Test.class" />
</exec>
</target>
<target name="clean">
<delete file="./Test.class"/>
</target>
</project>
when i run
bash-2.03$ ant ant
Buildfile: build.xml
ant:
[exec] /usr/local/j2sdk1_3_1_03/bin/javac
[javac] Compiling 1 source file to /home/lud/temp
[javac] [parsing started /home/lud/temp/Test.java]
[javac] [parsing completed 61ms]
[javac] [loading
/usr/local/j2sdk1_3_1_03/jre/lib/rt.jar(java/lang/Object.class)]
[javac] [loading
/usr/local/j2sdk1_3_1_03/jre/lib/rt.jar(java/lang/String.class)]
[javac] [loading
/usr/local/j2sdk1_3_1_03/jre/lib/rt.jar(java/util/HashMap.class)]
[javac] [checking Test]
[javac] [wrote /home/lud/temp/Test.class]
[javac] [total 1227ms]
[exec] No sourcepublic class Test extends java.lang.Object {
[exec] java.lang.String a;
[exec] int i;
[exec] java.util.HashMap h;
[exec] public Test();
[exec] public void f1();
[exec] }
[exec] -rw-r--r-- 1 lud other 234 Jul 11 08:56 Test.class
BUILD SUCCESSFUL
Total time: 3 seconds
bash-2.03$
when i run
bash-2.03$ ant javac
Buildfile: build.xml
javac:
[exec] /usr/local/j2sdk1_3_1_03/bin/javac
[exec] [parsing started ./Test.java]
[exec] [parsing completed 112ms]
[exec] [loading
/usr/local/j2sdk1_3_1_03/jre/lib/rt.jar(java/lang/Object.class)]
[exec] [loading
/usr/local/j2sdk1_3_1_03/jre/lib/rt.jar(java/lang/String.class)]
[exec] [loading
/usr/local/j2sdk1_3_1_03/jre/lib/rt.jar(java/util/HashMap.class)]
[exec] [checking Test]
[exec] [wrote ./Test.class]
[exec] [total 978ms]
[exec] Compiled from Test.java
[exec] public class Test extends java.lang.Object {
[exec] java.lang.String a;
[exec] int i;
[exec] java.util.HashMap h;
[exec] public Test();
[exec] public void f1();
[exec] }
[exec] -rw-r--r-- 1 lud other 309 Jul 11 08:57 Test.class
BUILD SUCCESSFUL
Total time: 3 seconds
bash-2.03$
these two steps give different class sizes and javap outputs!
how could this be?
thanks!
david
**********************************************************************
This message, including any attachments, contains confidential information intended
for a specific individual and purpose, and is protected by law. If you are not the
intended recipient, please contact sender immediately by reply e-mail and destroy all
copies. You are hereby notified that any disclosure, copying, or distribution of this
message, or the taking of any action based on it, is strictly prohibited.
TIAA-CREF
**********************************************************************
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>