Mailinglist Archive: opensuse (2459 mails)

< Previous Next >
Re: [opensuse] 10.3 uses different java locations
  • From: Glenn Holmer <gholmer@xxxxxxxxxxxxx>
  • Date: Wed, 12 Mar 2008 05:52:08 -0500
  • Message-id: <200803120552.08870.gholmer@xxxxxxxxxxxxx>
On Tuesday 11 March 2008 17:12:56 Frans de Boer wrote:
In trying to upgrade from jre 1.4.2 to 1.6, I found that the
structure is totally different then what SuSE has used before. It's
now a bewildering jungle of files and links and it is not clear how
to upgrade without spending hours of figuring out where to copy to
and what to update to make sure that Firefox as well as OpenOffice
find the updated JRE.

It's quite some time since SUSE just dumped the JDK into /usr/lib.

man update-alternatives

The idea is that you can just enter a single command that will just
terraform that entire forest of symlinks, e.g.

update-alternatives --config java
update-alternatives --config javac
update-alternatives --config java_sdk_sun
update-alternatives --config jre_sun

We script that on a test machine at work. But personally, I find the
whole /etc/alternatives system horrible. How would the average user
who needs to run a specific Java version find the above commands? As
the OP said, you used to be able to change Java versions by just
switching one link in /usr/lib.

In fact, you can still do it if you really want to: extract Sun's JDKs
into, say, /usr/lib/jdk-1.6.4 and /usr/lib/jdk-1.5.13 and symlink one
of them to /usr/lib/java. Then edit /etc/profile.local to
put /usr/lib/java/bin at the head of PATH and add
JAVA_HOME=/usr/lib/java. When you want to switch, just change the
symlink. Of course if you do that, you're responsible for updating
when new releases come out.

"After the vintage season came the aftermath - and Cenbe."
Glenn Holmer (Q-Link: ShadowM)
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups