Sunday, January 11, 2015

Manual Installation of Oracle Java 8 (JDK 8u25) in RHEL/CentOS 5 & Ubuntu 14.04

This post will assist you in installing Oracle Java 8 in RHEL 5, CentOS 5 and Ubuntu 14.04.

Java Archive Download

Download the latest Java SE Development Kit 8 from it's official download page.

Java Installation Using Alternatives

Extract the tarball and we will install it in /opt directory.

root:~# cd /opt
root:~# tar -xzvf jdk-8u25-linux-x64.tar.gz
root:~# alternatives --install /usr/bin/java java /opt/jdk1.8.0_25/bin/java 2
root:~# alternatives --config java

user@hostname:~$ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_25/bin/java 2
user@hostname:~$ sudo update-alternatives --config java

The java installation at this point of time is complete for both RHEL & Ubuntu. It is also recommended to setup javac and jar command paths using alternatives.



Testing Java Installation

To test the java installation run the below shown command. It should provide a similar output.



Setting Up the Environment

Setting up the environment variables helps the system to detect the desired java. It can be done by setting up the paths in .bashrc file in your home directory. It applies to both RHEL & Ubuntu.

No comments:

Post a Comment