Oracle Java JRE

All the Java components installed on Fedora (20) are provided by OpenJDK (Open Java Development Kit), a Free Software implementation of Java SE (Standard Edition).

It’s all you’ll need except when you have to install an application that requires Oracle JRE (Java Runtime Environment). One such application is the community edition of Datastax Cassandra, a NoSQL database. I thought I could uninstall OpenJDK and install Oracle JRE, but tightly-coupled dependencies made it a non-trivial task.

Later I found that both versions of Java (JRE) can live happily on the same machine by the use of the alternatives system, which is what this post is all about: How to install and use Oracle JRE on a Fedora machine that has OpenJDK JRE already installed. I wasn’t sure how this was going to play out, but so far, it has worked for me.

Related Post:  How to delete Superfish from Lenovo computers permanently

Here’s how I did it.

1. Download Oracle JRE: You can do that by visiting Java SE Downloads. For my installation, I downloaded the Java SE 7u67 version, to match the installed OpenJDK version. Save the RPM file to your Downloads folder.

2. Install Oracle JRE: To install it, cd to the Downloads folder, su to root, then type: yum install jre-7u67-linux-x64.rpm. It will be installed in the /usr/java directory. An ls of that directory will show the version you just installed. It should be jre1.7.0_67. OpenJDK is installed in /usr/bin/java. If you type java -version, the output should tell you what version the system is using. It should read something like this:


java version "1.7.0_65"
OpenJDK Runtime Environment (fedora-2.5.2.5.fc20-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

3. Configure the system to use Oracle JRE: This is where the alternatives command comes in. And it has to be run as root. To set up the newly installed Oracle JRE for use by the system, type: alternatives --install /usr/bin/java/ java /usr/java/jre1.7.0_67/bin/java 20000. After that command, the system will still be reporting OpenJDK when you query for the installed version. To change that, type: alternatives --config java. The system will present the two versions installed. Select the option 2, which should be Oracle JRE. Afterwards, query for the installed version to verify that the system is now using Oracle JRE. If you ever need to switch back to OpenJDK, just run the alternatives --config java.

Oracle Java JRE
Using alternatives to switch between Oracle JRE and OpenJDK JRE on Fedora 20

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

Leave a Reply

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

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.