Bug#445006: maven2: Selects first JRE found, ignoring alternatives (pending upload).

Paul Cager paul-debian at home.paulcager.org
Sun Oct 28 14:59:44 UTC 2007


tags 445006 +pending
thanks

The fix I previously suggested for this bug would not work with
java-gcj, due to the different ways the Java packages are set up in the
alternatives system. E.g.

  /usr/bin/java -> /etc/alternatives/java ->
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java

  /usr/bin/java -> /etc/alternatives/java ->
/usr/lib/jvm/java-gcj/bin/java -> /usr/bin/gij-4.2

I've modified the solution slightly to follow each individual symlink
(starting from the file returned by `which java`) until we find a
directory somewhere within the /usr/lib/jvm tree. At this point we can
correctly set up JAVA_HOME. If no JAVA_HOME has been found then I assume
it is a user-installed JRE and set JAVA_HOME appropriately.

I've tested it using java-6-sun, java-gcj, and a JDK installed under $HOME.

If you've any comments or corrections I would be pleased to hear them.
The full version of the patch can be found in

http://svn.debian.org/wsvn/pkg-java/trunk/maven2/debian/patches/mvn-cmd.patch?op=file&rev=0&sc=0

Thanks,
Paul





More information about the pkg-java-maintainers mailing list