Hi,
I have a web application that's compiled and deployed by an
ant build
The code has
java 1.5 api calls and a couple of enhanced for-loops in some classes. As I said, it compiles and works correctly on my machine (running ona Windows platform).
However when the same code is deployed on the client machine running on linux, things begin to go haywire.
For one, the java 1.5 specific code doesnt compile at all. An error was thrown for the enhanced for loops and some other 1.5 specific apis.
I ran the command
java -version,
which java and
which javac and all pointed to version java version 5.
Is there an ant setting somewhere that I have missed ?
The following is the ant javac command
Short of ideas and pretty desperate, I then changed my code to make it 1.4 compatible as it was throwing compile errors at 1.5 features.
Again the code compiled and worked on my machine.
And again I got bizzare compilation errors running the build on the linux box.
Here's the relevant part .......
I have an interface
And an abstract class implementing it
And a concrete subclass
Here's the output
Basically it was not allowing me to implement the abstract method (from the interface) with the exception signature.
I then, went into the abstract class and added the abstract method from the interface and voila, it worked.
Changed abstract class
Do I have to do this ? If a class implements an interface, arent the methods in the interface, available as abstract by default in the implementation class?
Does the abstract class necessarily have to define the method to be abstract?
I would think not, since it works for me in windows. But then why do I get the error running it on linux against a jdk1.5 compiler?
It cannot be a bug in the compiler because such elementary things would surely have been well tested?
Thanks,
Ram.