Bug#445006: maven2: Selects first JRE found, ignoring alternatives
Michael Koch
konqueror at gmx.de
Sat Oct 6 20:28:51 UTC 2007
On Tue, Oct 02, 2007 at 06:37:55PM +0200, Krzysztof Sobolewski wrote:
> Package: maven2
> Version: 2.0.7-1
> Severity: normal
>
> I have two Java packages installed: sun-java5-jre and sun-java6-jre.
> The latter is selected as /usr/bin/java by update-java-alternatives.
> Now when Maven starts, it tries to select $JAVA_HOME by looking
> into places where it might find Java (/usr/lib/jvm), apparently giving priority
> to Sun packages. Unfortunately, in my case, it selects java-1.5.0-sun,
> because it comes up first. This is mostly fine, but creates problems when,
> for example, I'm compiling a program that uses newer APIs.
>
> The start script should probably first try to determine where
> /usr/bin/java (or even `which java`) comes from.
The problem is that in the past not all JVM implementations worked for
all usecases. That is why we implemented a way to guess a working JVM.
This is wrong when new runtimes come up or change directories where they
are installed. Using /usr/bin/java would probably work for Maven but
/usr is no suitable setting for JAVA_HOME.
I dont really know what a good solution might be here. Probably its
using /usr as JAVA_HOME and /usr/bin/java as Java virtual machine and
let the local admin decide which runtime to use.
What are the opinion of others about this?
Cheers,
Michael
More information about the pkg-java-maintainers
mailing list