Re: java bytecode / java runtime version mismatch
Hi,
I thought, you need to set ant.build.javac.source _and_
ant.build.javac.target to be on the safe side (resp. -target and -source)?
Wouldn't it make sense to "police" this? i.e. to state that all packages
should be explicitly compiled with 1.5 source/target unless they use 6's
features?
Eric
Matthias Klose said:
> I filed bug reports for packages building with openjdk-6 or cacao-oj6,
> producing java bytecode for version 50, and which still depend on
> java-runtime5, or earlier (attached at the end).
>
> For lenny+1, when using openjdk/cacao as the default, there will be a
> lot more of these mismatches (I fixed about 30 packages in the
> pkg-java repo), so maybe a lintian check for this kind of mismatch
> would be nice.
>
> Matthias
>
> Bug mail:
> User: debian-java@lists.debian.org
> Usertags: jbc-mismatch
>
> This package builds with openjdk-6 or cacao-oj6, which is not the
> default jvm in testing/unstable. The openjdk-6 and cacao-oj6 javac
> creates java bytecode for version 50, which cannot be used by older
> jvms. Binary packages explicitely built with openjdk-6 or cacao-oj6
> must not depend on java-runtime{,1,2,5}{,-headless}, but only on
> java-runtime6{,-headless} or any of the non-virtual packages providing
> a java6 runtime.
>
> It is preferred to build the bytecode so that it runs on older jvms.
> This is done passing '-source 1.[45]' to javac (or for cdbs ant tasks
> setting ANT_OPTS to -Dant.build.javac.source=1.[45].
>
> You usually can check for the java byte code with file(1), currently
> broken in testing/unstable, or use javap -verbose (a script checking
> the command line args (check-class-version) can be found at
> http://people.debian.org/~doko/tmp/. Both .class and .jar files found
> in the binary packages need to be checked.
>
> Note: this report may be a false positive, if all bytecode files have
> version 49 or less.
--
Eric de France, d'Allemagne et de Navarre
Reply to: