In the above:
The javaplugin is available only in the Oracle JDK, not in the Oracle JRE only and not in openJDK.
As Miuku noted, openjdk needs to be removed.
Interestingly, I just tested removing openjdk with the following command which seems to remove openjdk but refuses to remove the “headless” packages. If you then go in and remove the headless packages specifically, it leaves the update-alternatives entries intact
You might find a better approach is to take a look at the scripts I used to install Oracle SE 7 JDK, I purposefully kept the scripts individual for maintenance reasons. Modify the script that contains the instructions for creating and updating “update-alternatives” for your own use.
Also, AFAIK you shouldn’t need to enter your JAVA environment variables elsewhere, it should be specified in update-alternatives as best practice.
As for your JEdit issue (don’t know where your other post is), the simple way to resolve is to find another Java app installed in KDE (or install one) to provide a template for how to do so correctly. So, I don’t know if it would work in KDE but I posted how to do this for LXDE (and likely works for XFCE). Note the commands and required flags… https://en.opensuse.org/User:Tsu2/LXDE-Main_Menu
I am having trouble with Oracle Java on 13.2. I much prefer openJDK but my tax authority refuses to work with openJava / IcedTea. Therefore I have installed 8u25, 8u31 and now 8u40 (removing iced tea) using a combination of instructions from the SDB and this thread. Everything was OK up to 8u31 but now I am out of my depth (again :’(). Here is present situation:
linux:/ # rpm -ql $(rpm -qa | grep jre) | grep libnpjp2.so
/usr/java/jre1.8.0_25/lib/amd64/libnpjp2.so
/usr/java/jre1.8.0_31/lib/amd64/libnpjp2.so
linux:/ # java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
I am using FF but the plugins show only 8u31. Installation of the latest version (8u40) generated the error message reported by others. I therefore switched to the .tar generic version. It appears to be properly installed but not recognized. Should I use the Java web site instructions to remove the old versions and rerun the symlink command?
Thanks DVCROFT. This worked for me. I made the adjustment for jdk/jre and i586/x64. The second command complained but I now have 8u40 and it shows up in FF. So SOLVED!
I tried that but it did not work as well. Then I tried running rpm with --nodeps option, which generated the expected errors related to the missing “alternatives” binary but installed the files. Then I ran:
Creating the symlink /usr/sbin/alternatives from /usr/sbin/update-alternatives does work. However it is a manually operation that needs to be done on all installs of the Oracle Java. We have the Oracle JDK/JRE in our yum repository which is installed on all servers we assemble. Having to maintain this symlink within an install script is not a good solution. It is a hack. Would it not be better to repackage the RPM for use on SUSE? We did not have this problem with Java 7, only with Java 8.
Why does SUSE have update-alternatives, while Fedora/Redhat have just alternatives? They are both an RPM-based distro.
I’ve read all the tips above, but the below simple way worked me. (OpenSUSE 13.2).
Simply downloaded the Oracle Java 1.8 package “java-1_8_0-sun” from OpenSUSE repo , the RPM version and installed normally:
tools1:~ # rpm -ivh /root/install/java-1_8_0-sun-1.8.92-18.1.x86_64.rpm
warning: /root/install/java-1_8_0-sun-1.8.92-18.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID b1c20679: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:java-1_8_0-sun-1.8.92-18.1 ################################# [100%]
update-alternatives: error: alternative javaws can't be slave of java: it is a slave of javaplugin
update-alternatives: using /usr/lib64/jvm/jre-1.8.0-sun to provide /usr/lib64/jvm/jre-sun (jre_sun) in auto mode
update-alternatives: using /usr/lib64/jvm-private/java-1_8_0-sun/jce/vanilla/local_policy.jar to provide /usr/lib64/jvm/jre-1.8.0-sun/lib/security/local_policy.jar (jce_1.8.0_sun_local_policy) in auto mode
tools1:~ #
I then ignored the error message from update-alternatives, it’s just a conflict about OpenJDK and Oracle Java.
Instead added Oracle java to the update-alternatives manually:
tools1:~ # update-alternatives --install /usr/bin/java java /usr/lib64/jvm/jre-1.8.0-sun/bin/java 20000
update-alternatives: using /usr/lib64/jvm/jre-1.8.0-sun/bin/java to provide /usr/bin/java (java) in auto mode
tools1:~ #
Done.
List of java’s:
tools1:~ # update-alternatives --list java
/usr/lib64/jvm/jre-1.7.0-openjdk/bin/java
/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
/usr/lib64/jvm/jre-1.8.0-sun/bin/java
tools1:~ #
tools1:~ # update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib64/jvm/jre-1.8.0-sun/bin/java 20000 auto mode
1 /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java 1705 manual mode
2 /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java 1805 manual mode
3 /usr/lib64/jvm/jre-1.8.0-sun/bin/java 20000 manual mode
Press enter to keep the current choice
[li], or type selection number: 0[/li]tools1:~ #
The Oracle Java is started with java command:
tools1:~ # java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
tools1:~ #