[kaffe] kaffe/jikes makes incompatible code for jdk1.3? (was: [Detelin Batchovski] Bug#262897: libservlet2.3-java_4.0-4: Failed start Tomcat4 after upgrade)

Dalibor Topic robilad at kaffe.org
Thu Aug 5 02:05:47 PDT 2004


Arnaud Vandyck wrote:
> Hi everybody,
> 
> I built javax.servlet with kaffe/jikes/ant1.6, but when running with
> jre1.3, it seems there is a problem... log is attached.
> 
> Thanks to help.
> 
> Debian:
> 
>   If the problem could not be solved soon, it means we'll have to build
>   servlet with non-free JDK again!
> 
>   It means libservlet2.3-java back to contrib!
> 
> I'll wait two or three days before uploading a servlet compiled with
> non-free jdk back to contrib, hoping kaffe guys can resolve this (but I
> assume it's not trivial!).
> 
> Comments?

Salut Arnaud,

Sorry for not being able to respond sooner.

The problem is in the class versions. Depending on which version of 
jikes you use, it generates class files for different target vms by 
default. More recent versions of jikes target more recent versions of 
JDK. The same thing could happen if you had used JDK 1.4 to build the 
classes.

Since Sun changed[1] the byte code format with every major JDK relese 
(and ocassionally in-between releases), you need to tell Jikes 
explicitely which is the lowest JDK version you want to target. If you 
are using ant, you can do that by setting the target attribute of the 
javac task to the runtime version you ant to target.

Caveat: If the code uses APIs or language features from a different 
version of Java and JDK, then compiling to an earlier byte code format 
would not solve the problem. But if libservlet is supposed to work with 
JDK 1.3, then changing the build.xml file to target 1.3 by default and 
filing a bug upstream should be a quick solution.

cheers,
dalibor topic

[1] And didn't document the changes, of course. :)



More information about the kaffe mailing list