Glenn Holmer wrote:
What is up with the insane tangle of symlinks that makes up jpackage??! I remember how easy it used to be just to change the link /usr/lib/java and everything would be good. I don't find any documentation on how to do this anymore.
What is the "canonical" way to switch back and forth between 1.4 and 1.5 in SUSE 9.3? surely not by editing all the symlinks in /etc/alternatives, or by uninstalling and reinstalling one or the other every time you want to switch?
You should use the "update-alternatives" command if you want to switch to a different default java implementation, "man update-alternatives" will help a bit, but here is my understanding of how to use it on a properly configured system : Update-alternatives manages files in groups - you can work out the group names by listing /var/lib/rpm/alternatives, on my system (SuSE 9.3) this is: antlr eclipse_bin java javac java_sdk_1.4.2 java_sdk_1.5.0 java_sdk_sun jaxp_parser_impl jce_1.4.2_sun_local_policy jce_1.5.0_sun_local_policy jmxri jre_1.4.2 jre_1.5.0 jre_sun servlet "update-alternatives --display <name>" will show the state of any of these, and the list of slave packages in each group. On my system to completely switch I update "java", "javac", "java_sdk_sun" and "jre_sun" (I'm not totally clear on what the last two do by the way :) To change the currently selected alternative, run (as root) "update-alternatives --config java" - you will get an interactive prompt where you can change the java version, which will change the symlinks in /etc/alternatives. Then do the same for "javac", "java_sdk_sun" and "jre_sun". "update-alternatives --auto <name>" will revert to auto-mode. I'm not sure how you change the priorities of "auto" mode, I suspect there is some way (apart from re-running "update-alternatives --install", or manually editing config files) but I haven't found it yet. I'm also not sure how to do this for a single shell, like the old system allowed. You can get there manually by setting environment variables (as defined in /etc/java/java.conf) and manually running the right "java" or "javac" binary, but I haven't really tested this in detail. - Korny -- Kornelis Sietsma e-mail: korny at my surname dot com