Install Oracle JDK on OpenSUSE

Due to licensing issues, OpenSUSE comes with OpenJDK. I personally prefer using Oracle’s JDK. It’s worth mentioning that OpenJDK will not work in some cases such as building Android source code and it’s not recommended for Android development.

Here is how to install and setup Oracle JDK on OpenSUSE.

1. Download the JDK from Oracle’s site. I use 64-bit OpenSUSE so i downloaded the ‘Linux x64‘ version rpm. For 32 bit systems download the ‘i586′ version of the package.

2. Install the JDK by opening a terminal, becoming root and switching to the directory where you downloaded the RPM package.

For x64 version execute:

rpm -i jdk-8u5-linux-x64.rpm

For 32-bit version execute:

rpm -i jdk-8u11-linux-i586.rpm

3. Make the OracleJDK default system JDK.

While at the terminal and with root privileges execute the following sequence of commands:

update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_05/bin/java 1551
update-alternatives --install /usr/bin/javadoc javadoc /usr/java/jdk1.8.0_05/bin/javadoc 1551
update-alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0_05/bin/jar 1551
update-alternatives --install /usr/bin/javap javap /usr/java/jdk1.8.0_05/bin/javap 1551
update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_05/bin/javac 1551
update-alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.8.0_05/bin/javaws 1551
update-alternatives --install /usr/bin/javah javah /usr/java/jdk1.8.0_05/bin/javah 1551
update-alternatives --install /usr/bin/jarsigner jarsigner /usr/java/jdk1.8.0_05/bin/jarsigner 1551

4. Define JAVA_HOME environment variable.

Type ‘exit‘ at the terminal to become your normal everyday user again. Open .bashrc in your favorite command line text editor and the following:

export JAVA_HOME=/usr/java/jdk1.8.0_05

Save the file and exit from the editor. Type:

source .bashrc

5. Verify Java version by typing ‘java -version‘ it should says “java version “1.8.0_05”“. If that’s the case you have OracleJDK correctly installed.

Related Post

Gentoo Linux: Ugly fonts in NetBeans and how to fi... I recently installed Gentoo GNU/Linux + KDE 5 on my dev machine. One thing that was bugging me was the crappy font rendering in NetBeans. To relol...
GSM Signal Monitor 1.5 out now! GSM Signal Monitor 1.5 is out now! This version features new app visual style, additional logging options, bug fixes and Android 5.x and up support...
Alien Swarm 1.4.1 out now! Alien Swarm version 1.4.1 is out now! This is the best ‘Alien Swarm’ release to date. Featuring Facebook and Google+ share integration, so you ...
Alien Swarm 1.4 out now! Alien Swarm version 1.4 brings our 'shoot everything that moves' game on the big screen! The game is now available for Android TV. This update...
Happy Fruits is out now! Happy Fruits is a simple match-3 puzzle game similar to Jewels / Bejeweled type of games. Your goal is to swap adjacent fruits to create combinat...
Tic Tac Toe 4.0.1 Tic Tac Toe v4.0.1 is here. This release focus is on improving performance, fixing visual glitches and bugs. Version 4.0.1 Change log: * Fixed...
This entry was posted in Android, GNU/Linux, Java, Mobile and tagged , , , , , , , , , , . Bookmark the permalink.

6 Responses to Install Oracle JDK on OpenSUSE

  1. Pingback: [OpenSUSE]安裝Java並調教出Android Studio用。 | 第三機關

  2. Nicolas says:

    Where is the baschr file??

  3. Philippe says:

    The first line of “update alternatives” works fine. The other ones do not. I get an error message. For example, for the second line the error is “update-alternatives: error: alternative javadoc can’t be master: it is a slave of javac”
    I get similar messages for the other lines.

  4. Andre says:

    download latest JDK & JRE from here: (download tar.gz packages!!)

    download my .sh script here to set JDK and JRE and update .bashrc file


  5. Alexis says:

    Hi i have lost in the last part, when have to create the Open.bashrc, where to save it (i mean directory), also how to see the “java-version”. Hope can help me with that.

Leave a Reply

Your email address will not be published. Required fields are marked *