How to install Oracle JRE on Fedora 20 and use alternatives to switch between it and OpenJDK

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:  Takeoff with the K Desktop Environment's best menu style

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 run network ads?  Yep, no more ads from the usual suspects that track and annoy 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 or your favorite cryptocurrency.

  • Bitcoin
  • Ethereum
  • Xrp
  • Bitcoin cash
  • Bitcoin sv
  • Litecoin
  • Binance coin
  • Cardano
  • Ethereum classic
Scan to Donate Bitcoin to bc1qzvlte2m224zkayhdc7fdfjkp2rsgt0l5a496ua

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Scan to Donate Ethereum to 0x0F4362DFF77F3Ba0Dc637F5f3Eba35D09a2fA60C

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Xrp to r4ggjvL36njsMCYTkJ3S7cTHscPsMsSGQv

Donate Xrp to this address

Scan the QR code or copy the address below into your wallet to send some Xrp

Scan to Donate Bitcoin cash to qrs0dedzp9t55af3nfwypydghp29r0xguy9s20fz2k

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Bitcoin sv to 15K9TLyVDBtLuG9cYvXCX9SSkq9C9oUKHK

Donate Bitcoin sv to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin sv

Scan to Donate Litecoin to LetJ9QQMb7u2LMZ9Tu6rtHwcBcQFW98fbG

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Binance coin to bnb1ga8trq08ssqepd90v6225nzfgy448pu5pw8gxp

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Cardano to addr1qx2354yw49etstfljpdhwja3ajjlt487lg95vu9ngy2q6vu4rf2ga2tjhqknlyzmwa9mrm997h20a7stgectxsg5p5esq5l7d9

Donate Cardano to this address

Scan the QR code or copy the address below into your wallet to send some Cardano

Scan to Donate Ethereum classic to 0xcD6CC972a2297FcafACDcfE042C55C69516a9264

Donate Ethereum classic to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum classic

Subscribe for updates. Trust me, no spam!

Sponsored links

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

Upcoming events

Leave a Reply

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

Get the latest

On social media
Via my newsletter

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
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.