Use Oracle JDK instead of openjdk

Background

I have to use oracle jdk because of homework and some software like docear.
But with openSuse 13.2 openjdk 1.8 is default. It is similar with other Linux system.
So install oracle jdk and change it without uninstall openjdk is a good idea.

Step

  1. download “Java Platform (JDK) 8u60” on the offical website(refering xcodeghost T_T).
    Actually I download “NetBeans with JDK 8”.It depends on you.
  2. select your platform, download the file, check Checksum, and then install it.
  3. Remeber your installation directory. Then it’s time to set environment.
  4. edit ~/.bashrc, add the following lines and save
    1
    2
    export JAVA_HOME=[your installation path of jdk]
    export PATH=$JAVA_HOME/bin:$PATH

Then oracle jdk works after restart your terminal.

References