Welcome to Codefind4you !

Follow Me

How to Install JDK on OpenSUSE Leap 42.1 x86_64.


This tutorial will cover the installation of 64-bit JDK 8u112 on OpenSUSE

  1. Update OS
     zypper update
  2. Checking the current java version and remove OpenJDK (if you want)
     java -version

     zypper remove *OpenJDK*
  3. Checking the java version again(if you want to confirm whether OpenJDK
    is removed
    )
  4. Make a directory “java” in /usr/local/
     cd /usr/local/

     mkdir java
  5. Move to “java” directory and Download “jdk-8u112-linux-x64.tar.gz” file
    into the /usr/local/java directory as shown below.
     cd java

     
    wget --no-cookies --no-check-certificate --header "Cookie:  gpw_e24=http%3A%2F%2Fwww.oracle.com%2F;
     oraclelicense=accept-securebackup-  cookie" "http://download.oracle.com/otn-  pub/java/jdk/8u112-b15/jdk-8u112-linux-  x64.tar.gz"

  6. Once file has been downloaded, you may extract the tarball using the tar command  and delete tar file as shown below.
     tar -zxvf jdk-8u112-linux-x64.tar.gz

     rm -rf jdk-8u112-linux-x64.tar.gz
     


  7. Create “latest” directory and create link as shown below
     ln -s jdk1.8.0_112 latest


  8. Edit “bashrc” file and insert the code as shown below
     vim ~/.bashrc

     export JAVA_HOME=/usr/local/java/latest
     export PATH=$JAVA_HOME/bin:$PATH

  9. Reload the “.bashrc file .
     source ~/.bashrc
  10. Edit “bash_profile” file and insert the code as shown below
    vi ~.bash_profile

    if [ -f ~/.bashrc ]; then
                    source ~/.bashrc
    fi
  11. Checking the java version and javac working.


Contact Form

Name

Email *

Message *

Translate