recent java changes (enforcing gcj)

Paweł Zuzelski z at xatka.net
Thu Mar 12 15:49:54 CET 2009


On Wed, 11 Mar 2009, Jakub Bogusz wrote:

> There should be a way to build packages using jdk - without need to
> uninstall java-sun and replace it with gcj - e.g. by %bcond_with jdk.

IMO we should enforce a specified implemetation of jdk even
for packages that can be build using both jdks, because package
built with java-sun differ from the same package built with
java-gcj-compat-devel. Main differences are:

1.  default ClassDataVersion for sun's javac is 50. That means it is
  not compatibile with gij JVM. Default ClassDataVersion for
  gcj is 49. Such .class file can be run with both gij and
  sun JVM.
2. javadoc generated by gjdoc and one generated by sun javadoc are
  different. Even list of generated files differ.

We do not want our packages to depend from the build environment.
I prefer gcj because gcj works on all archs supported in th. 

BTW there should be a simple way to install a few versions of java
(or at least java-sun{,-jre} and java-gcj-compat{,-devel}).
By "simple" I mean without --relocate, --excludedocs, --oldpackage etc

In debian it is handled by "alternatives" (/usr/bin/* files are not
packaged, so different jvm/jdk packages do not conflicts. /usr/bin/*
files are symlinks generated in post scriptlets).

Mayby we should move conflicting files to subpackage. In such case
to set a default version of java, one can install this subpackage.
To use other versions one have to set JAVA_HOME variable (or define
%java_home macro)

> Also, removing versioned jre Requires doesn't look good to me - the
> required versions were put not without reason.

This dependency should be autogenerated and it should look like
that: R: java(ClassDataVersion) = n

There is a bug in "file" command, that results in wrong
classification of java class files. It is fixed in PLD by patch
added in file-4.26-4, so now java dependencies are generated
correctly.

-- 
Paweł


More information about the pld-devel-en mailing list