I always thought Ant just used the standard javac. Maybe you're using a different version of Java to compile and run the code. Java seems to be backward compatable, i.e. if you compile on 1.4, you can run it on the 1.3, but not vice versa. Maybe you have an old javac hanging around somewhere, and that is what Ant is using based on your classpath. I would check the path again, and also try to compile just that problem class with your javac, without Ant or JBuilder. Ant is just a build script, like .bat file, only easier.
Greg
-----Original Message-----
From: Gregory A. Swarthout [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 25, 2003 12:24 PM
To: JDJList
Subject: [jdjlist] How Ant compiles vs. how JBuilder compiles
I'm having a problem with a program I've written and I've traced it to
the compiler. If I compile with JBuilder using JDK 1.4.1_01,
everything works as it should. If I compile with Ant's javac task
using JDK 1.4.1_01 as well, the problem occurs.
I've noticed in the past that the outputs of each compile are slightly
different, though until this one modification to my class, the
difference made no difference. The problem comes into play
serializing an inner class. It works correctly when compiled with
JBuilder, but the program tries to serialize the main class when
compiled under Ant.
I don't know what JBuilder is doing under the covers, so I don't know
how to fix the Ant compile task.
The one obvious difference in the outputs is that in addition to:
MyClass$1.class
MyClass$2.class
MyClass$3.class
MyClass$4.class
only the JBuilder compile also produces the file:
MyClass$$5.class
(note the two $'s).
Anyone know what's going on and/or how to fix it?
Greg
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________
