Boy am I struggling trying to understand how to use update-alternatives and wonder if some kind soul might give me a few pointers. And a heads up, I suspect this might take some thought on some kind guru's part... Basically I am trying to install the Oracle/Sun version of Java on my systems. (and yes I know that Novell/openSuSE and Oracle got into a snit over license agreements, and as a user of Java I am pretty mad about the decision to drop the installation support for it. So I am tasked with trying to install the Oracle version since the openJDK flat out does not work for either Eclipse or our Web Start applications.) OpenSuSE12.1 has apparently dropped the ball on Java in that a number of Java related environment variable, such as JAVA_HOME, JVM_ROOT etc no longer get initialized for a given Java installation. It appears that our old reliable friend "setJava" got booted, so apparently /etc/java/java.conf and whatever else setJava used, is now useless and I do not grok why these files are still around, it just makes things even more confusing. The job of setting these environment variables appears to have fallen to a script in /etc/profile.d/allJava.sh or allJava.csh. So now my job is (I think) to configure things with update-alternatives so that an installation of the Oracle/Sun Java will work properly. The RPM installation files from Oracle install the Java files under /usr/java and not under /usr/lib/jvm or /usr/lib64/jvm which is where OpenSuSE12.1 seems to want them. And to make things worse, some braindead fool at Oracle or Sun decided to supply us Linux users with a self extracting shell script for installing the Java EE SDK that requires you to have already installed the JDK for Java SE BEFORE you can run the Java EE installation script! And you can guess at what assumptions are made on where the SE version was installed. In other words, you gotta have a Sun Java JDK installed in order to install a Sun Java EE SDK! Go figure.... The script allJava.sh makes it's decisions by first determining which lib dir - /usr/lib or /usr/lib64 should be used. Once it has figured that out, it then searches the sub directory jvm for the existence of the link/dirs java and jre. If it finds these then it proceeds to setting the environment variables Java apps needs. I initially noted that neither the "java" nor the "jre" link/dirs existed in either of the lib jvm locations! I dunno why not, but that breaks that script so none of these Java environment variables are getting set. Anywise, I proceeded to try and set up the links as follows for the Oracle/Sun installation - sudo /usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/java/latest/bin/java" 40 sudo /usr/sbin/update-alternatives --config java and selected my new version of java. Next, to get allJava.sh working I tried to do the following (for my x64 laptop, a 32 bit version would be somewhat similar if this worked..) sudo /usr/sbin/update-alternatives --install "/usr/lib64/jvm/java" "java_sdk" "/usr/java/latest" 50 sudo /usr/sbin/update-alternatives --install "/usr/lib64/jvm/jre" "java_jre" "/usr/java/latest/jre" 50 and BOOM! I got told the following error - update-alternatives: error: alternative link /usr/lib64/jvm/jre is already managed by java. I then queried the java alternatives - sudo /usr/sbin/update-alternatives --query java Link: java Status: manual Best: /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java Value: /usr/java/latest/bin/java Alternative: /usr/java/latest/bin/java Priority: 40 Slaves: Alternative: /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java Priority: 17105 Slaves: java.1.gz /usr/share/man/man1/java-java-1.6.0-openjdk.1.gz jre /usr/lib64/jvm/jre-1.6.0-openjdk jre_exports /usr/lib64/jvm-exports/jre-1.6.0-openjdk keytool /usr/lib64/jvm/jre-1.6.0-openjdk/bin/keytool keytool.1.gz /usr/share/man/man1/keytool-java-1.6.0-openjdk.1.gz orbd /usr/lib64/jvm/jre-1.6.0-openjdk/bin/orbd orbd.1.gz /usr/share/man/man1/orbd-java-1.6.0-openjdk.1.gz policytool /usr/lib64/jvm/jre-1.6.0-openjdk/bin/policytool policytool.1.gz /usr/share/man/man1/policytool-java-1.6.0-openjdk.1.gz rmid /usr/lib64/jvm/jre-1.6.0-openjdk/bin/rmid rmid.1.gz /usr/share/man/man1/rmid-java-1.6.0-openjdk.1.gz rmiregistry /usr/lib64/jvm/jre-1.6.0-openjdk/bin/rmiregistry rmiregistry.1.gz /usr/share/man/man1/rmiregistry-java-1.6.0-openjdk.1.gz servertool /usr/lib64/jvm/jre-1.6.0-openjdk/bin/servertool servertool.1.gz /usr/share/man/man1/servertool-java-1.6.0-openjdk.1.gz tnameserv /usr/lib64/jvm/jre-1.6.0-openjdk/bin/tnameserv tnameserv.1.gz /usr/share/man/man1/tnameserv-java-1.6.0-openjdk.1.gz and WOWZA this slave stuff is hard to follow! I can see there is a slave setting for jre but I do not understand how one is to supply an alternative setting for it. What is worse is that this output from the query seems to be missing a crucial bit of information. According to the man page on update-alternatives, in order to configure a slave link, one has to supply a "generic name for the master link" of the slave link, but this "generic name" is NOT shown in this output. So I got no idea what is needed, perhaps if someone could point me to a script that sets these up for the openJDK Java I might be able to grok this better. I took a shot in the dark and tried to do the following - sudo /usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/java/latest/bin/java" 40 --slave "/usr/lib64/jvm/jre" "java_jre" "/usr/java/latest/jre" and that BROKE things seriously. Apparently update-alternatives tried to do something, because it spit out the following warning - update-alternatives: warning: forcing reinstallation of alternative /usr/java/latest/bin/java because link group java is broken. And after that, I couldn't do anything further with it, for example - sudo /usr/sbin/update-alternatives --query java update-alternatives: error: /var/lib/rpm/alternatives/java corrupt: duplicate slave link /usr/lib64/jvm/jre So much for robust software! Anywise, I managed to track down the location of the data base for update-alternatives and edit files directly to remove my wonderful additions, uninstalled and reinstalled openJDK and got update-alternatives back up and running. (Note to developers - PLEASE include documentation on where and how to manually repair things when your spiffy apps go haywire on a poor user! Took me hours to track this down!) At this point I am stuck and dunno how to create an alternative link for the slave jre link. I could just give up and create the links I need by hand, but after putting in so much time on this, I think others might like to know how to get an Oracle/Sun Java installation to work properly in this new model and I would be willing to write up some documentation in return for some help... Thanks in advance.. Marc.. -- "The Truth is out there" - Spooky -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org