[opensuse] update-alternatives configuration questions for Java
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
On 04/20/2012 07:23 AM, Marc Chamberlin wrote:
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.)
Maybe that's not what you expected, but why not leaving the system's java installation as it is and install the JRE/JDK in the user's directory using the .sh installer? I'm using that for our custom web applications: I have my own JDK and tomcat installation, so I don't have to fuzz about which versions are on the system, java4/5/6/7/...? Mine application just matches, i.e. has been built and tested with my private installation. I only had to ensure that no JAVA environment variable is set pointing to the system's java installation. unset JRE_HOME unset JAVA_ROOT unset JAVA_BINDIR and then set and export JAVA_HOME appropriately. Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 4/19/2012 10:47 PM, Bernhard Voelker wrote:
On 04/20/2012 07:23 AM, Marc Chamberlin wrote:
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.) Maybe that's not what you expected, but why not leaving the system's java installation as it is and install the JRE/JDK in the user's directory using the .sh installer?
I'm using that for our custom web applications: I have my own JDK and tomcat installation, so I don't have to fuzz about which versions are on the system, java4/5/6/7/...? Mine application just matches, i.e. has been built and tested with my private installation.
I only had to ensure that no JAVA environment variable is set pointing to the system's java installation. unset JRE_HOME unset JAVA_ROOT unset JAVA_BINDIR and then set and export JAVA_HOME appropriately.
Have a nice day, Berny
LOL Thanks Berny, sometimes the easiest solutions are not so obvious and you have a good idea. Although it makes me feel a bit like a rat leaving a sinking Java ship to abandon the model being promoted by the openSuSE developers... I will pursue your path in parallel and if the openSuSE developers want to help me make their model workable I will be happy to contribute also... 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
Marc Chamberlin wrote:
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.)
I was interested by "the openJDK flat out does not work for .. Eclipse", so I googled but didn't find anything about this problem. Do you have a link to bug reports or other descriptions of this problem please? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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.) I was interested by "the openJDK flat out does not work for .. Eclipse", so I googled but didn't find anything about this problem. Do you have a
Marc Chamberlin wrote: link to bug reports or other descriptions of this problem please? Dave - I have not reported the problem with Eclipse to openSuSE, about using the openJDK version of Java to run it under. But I have
On 4/20/2012 2:40 AM, Dave Howorth wrote: participated in and seen discussions about it on the Eclipse users news/mail group and this problem has been ongoing for a long time now. The consensus has been to use the Sun Java tools, especially when debugging Web Start applications and Tomcat servlets, which I need to do. Anywise, if I switch my system back to using the openJDK version of Java and try to start up Eclipse, this is what happens - marc@marcslaptop:~/eclipse/eclipse_64> ./eclipse # # A fatal error has been detected by the Java Runtime Environment: # # SIGBUS (0x7) at pc=0x00007fd50423b474, pid=26611, tid=140552917538560 # # JRE version: 6.0_24-b24 # Java VM: OpenJDK 64-Bit Server VM (20.0-b12 mixed mode linux-amd64 compressed oops) # Derivative: IcedTea6 1.11.1 # Distribution: Dummy Product (x86_64), package suse-3.1-x86_64 # Problematic frame: # C [libzip.so+0x4474] Java_java_util_zip_ZipEntry_initFields+0x6f4 # # An error report file with more information is saved as: # /home/marc/eclipse/eclipse_64/hs_err_pid26611.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # I could send you, or whomever, the log file if you like, it is rather lengthy. I am unable to decipher it and figure out what is wrong, just know that in the past I was successful with running eclipse using the Sun Java VM instead, so am in the process of pursuing that route instead. At the moment, under openSuSE12.1 I don't have eclipse running under the Oracle/Sun version yet because of these other issues with the environment variables, but I had no problems getting it to run in openSuSE11.4 and 11.3 so figure that is my best and quickest route.... 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
participants (3)
-
Bernhard Voelker
-
Dave Howorth
-
Marc Chamberlin