First time in several years I’ve had to install Oracle JDK in a system.
Looked around for various updated info and am floored by how complex it is now to install Oracle Java into openSUSE… Previously I simply followed the MAN page info and that was it. Maybe I did enough before, maybe not.
Anyway, there is a comprehensive SDB
- **Although the SDB describes uninstalling openJDK, I doubt it’s necessary since one of the main purposes of using update-alternatives is to be able to switch between Java.
- Know beforehand (or follow the steps in the SDB), there are specific options for installing 32bit vs 64bit, JRE vs JDK and more.
- Apparently this SDB is maintained and being updated to support the current stable version downloaded from Oracle, so if that is what you are installing you only need to copy the commands as shown and execute (There are hundreds if you’re installing the JDK with full Dev support! Whew!)
- The SDB uses “sudo” extensively which is OK. Of course, you can simply execute all commands in a root console, then “sudo” commands make no diff (can exist or be removed, doesn’t matter).
- Although the SDB describes downloading the Oracle TAR and then moving the extracted files into /usr/lib or /usr/lib64,** I had already installed the Oracle RPM**. Instead of moving the files around, I simply modified creating the symbolic links to point to the already installed files which instead are at /usr/java as follows(you can modify or additionally point to /usr/lib in the following for 32bit support)
Note: Modify the following to reflect the <exact> version and sub-version of the Oracle Java you are installing
ln -s -T /usr/java/jdk1.7.0_51/ /usr/lib64/jdk_Oracle