How To Install JAVA 8 In OpenSUSE 13.x / SLES Servers

In this tutorial, we will show you how to install Java in SUSE or OpenSUSE Environments. In this tutorial, we are using our virtual machine OpenSUSE.

This is my testing system:

cat /etc/os-release
NAME=openSUSE 
VERSION="42.1 Milestone 1 (Malachite)" 
VERSION_ID="42.1milestone1" 
PRETTY_NAME="openSUSE Leap 42.1 Milestone 1 (Malachite) (x86_64)" 
ID=opensuse 
ANSI_COLOR="0;32" 
CPE_NAME="cpe:/o:opensuse:opensuse:42.1" 
BUG_REPORT_URL="https://bugs.opensuse.org" 
HOME_URL="https://opensuse.org/" 
ID_LIKE="suse"

First Download the file from the oracle website.

Download the rpm installer jre-8u51-linux-x64.rpm from the oracle java site at:

Start Install Java

rpm  -ivh  jre-8u51-linux-x64.rpm
error: Failed dependencies: 
        /usr/sbin/alternatives is needed by jre1.8.0_51-1.8.0_51-fcs.x86_64
Solve it with: Make symbolic link to /usr/sbin/alternatives:
ln -s /usr/sbin/update-alternatives /usr/sbin/alternatives
Install without dependencies:
rpm  -ivh   --nodeps jre-8u51-linux-x64.rpm
Preparing...                          ################################# [100%] 
Updating / installing... 
   1:jre1.8.0_51-1.8.0_51-fcs         ################################# [100%] 
Unpacking JAR files... 
        rt.jar... 
        jsse.jar... 
        charsets.jar... 
        localedata.jar... 
        jfxrt.jar... 
        plugin.jar... 
        javaws.jar... 
        deploy.jar... 
update-alternatives: using /usr/java/jre1.8.0_51/bin/java to provide /usr/bin/java (java) in auto mode
Start Java configuration:

Run as root:


alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.7.0_40/bin/java" 1
update-alternatives --set java /usr/java/jre1.8.0_51/bin/java
lternatives --install "/usr/lib64/browser-plugins/javaplugin.so" "javaplugin" "/usr/jav
a/jre1.8.0_51/lib/amd64/libnpjp2.so" 1
update-alternatives --set javaplugin /usr/java/jre1.8.0_51/lib/amd64/libnpjp2.so

 

Now check with root user:


<span style="color: #ff0000;">update-alternatives --list java</span>
/usr/java/jre1.8.0_51/bin/java
/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
update-alternatives --list javaplugin
/usr/java/jre1.8.0_51/lib/amd64/libnpjp2.so
update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java). 
 
  Selection    Path                                       Priority   Status 
------------------------------------------------------------ 
  0            /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java   1805      auto mode 
* 1            /usr/java/jre1.8.0_51/bin/java              1         manual mode 
  2            /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java   1805      manual mode
Press enter to keep the current choice[*], or type selection number: 

<span style="color: #ff0000;">update-alternatives --config javaplugin</span>
There is 1 choice for the alternative javaplugin (providing /usr/lib64/browser-plugins/javaplugin.so).  Selection    Path                                         Priority   Status ------------------------------------------------------------  0            /usr/java/jre1.8.0_51/lib/amd64/libnpjp2.so   1         auto mode * 1            /usr/java/jre1.8.0_51/lib/amd64/libnpjp2.so   1         manual mode Press enter to keep the current choice[*], or type selection number:

For 32bit version:

update-alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.8.0_51/bin/java" 1

update-alternatives --set java /usr/java/jre1.8.0_51/bin/java

update-alternatives --install "/usr/lib/browser-plugins/javaplugin.so" "javaplugin" "/usr/java/jre1.8.0_51/lib/i386/libnpjp2.so" 1

update-alternatives --set javaplugin /usr/java/jre1.8.0_51/lib/i386/libnpjp2.so

Verify the Java version:

Run the following commands as root user.

inux-0xn4:/home/mohamed/Downloads # java   -version 
java version "1.8.0_51" 
Java(TM) SE Runtime Environment (build 1.8.0_51-b16) 
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

Test java plugin installed:

Please check your plugin on https://www.java.com/verify

snapshot1

Done!