It doesn’t play a part in the installation of the software (that’s up to you to do) per se. It’s a command line utility that, for some items, allows you to switch/set the app you want the system to use by default. It should be installed by default on your system IIRC. For more info, read the output of “man update-alternatives”.
As an example:
update-alternatives --config java
will allow you to switch between installed versions as the system default java to run.
As you are intending to only use one app with 1.7, if that particular app allows you to config the path to the java version you want to use (and is also cognizant of the respective java environment variables), then you won’t even need to be switching back and forth via update-alternatives.
How do I install only the JRE? (Looking at the links, I find only full sdk install options)
there are separate downloads the jre and sdk. Not sure what you are looking at or missing.
Thanks I installed that but now (as I did not want) JRE 1.7 has replaced 1.6 (even though both are installed) When I type “java -version” on the command line it saya 1.7. How do I get 1.6 back?
EDIT: What’s weird is I have a file “/usr/bin/java” but that file is NOT in the “file list” of any of the packages!
When I try using update-alternatives, it doesn’t work:
sudo /usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin/java" 1
update-alternatives: warning: forcing reinstallation of alternative /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java because link group java is broken.
update-alternatives: warning: not replacing /usr/share/applications/policytool.desktop with a link.
I’m guessing the “1” choice was just created by me. I see that the path it expects is “/usr/lib64/jvm/jre-…” not “/usr/lib64/jvm/java…” even though the latter is what exists in the file list in Software Management for the packages. How confusing and unclear!
I see further on in the thread you discovered the wonders of update-alternatives
EDIT: What’s weird is I have a file “/usr/bin/java” but that file is NOT in the “file list” of any of the packages!
/usr/bin/java is just a symbolic link … in your file manager, dolphin for example, right click on the file and select properties, and it should display the target … for me, that happens to be /etc/alternatives/java … which is, itself, a smybolic link that points to … eventually going down the garden path you get to the actual java app.