In this article we are going to see how to install different Java version on your linux system and also how to make it as a default one.
Installing through yum:
When we install java directly the current version is JDK-1.8.0_181
$ yum install java
To check the version of the Java use the below command,
$ which java
jhony@ljunix~$ which java
/usr/bin/java
$ java -version
jhony@ljunix~$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
We can run our applications on different Java versions through source installation.
Installing through source:
Download the latest file from the official site. Click the following link for downloading the latest version ORACLE.COM. You have to accept the License Agreement to get the download link for the required version.
Note: You cannot download the package through wget. It is recommended to download the package on your system and scp the tar file to the required server.
Untar the file:
$ tar -xzf jdk-8u191-linux-x64.tar.gz
Move the extracted file to /usr/local/ directory,
$ mv jdk1.8.0_191/ /usr/local/
Export the JAVA_HOME and PATH to the installed JDK,
Comments