Java Installation Process in Linux – Complete guide

java-installation-in-linux
Spread the Knowledge

java-installation-in-linux

Download, Install and Configure JDK 8 & JRE 8

Platfrom – Debian & Ubuntu

[code]
#JRE8 – Package contains just the Java Runtime Environment 8
$ sudo apt-get install openjdk-8-jre

#JKD8 – Package contains just the Java Developement Environment 8
$ sudo apt-get install openjdk-8-jdk
[/code]

Platfrom – Fedora, Oracle Linux, Red Hat Enterprise Linux, etc

[code]
#JRE8 – Package contains just the Java Runtime Environment 8
$ su -c “yum install java-1.8.0-openjdk”

#JKD8 – Package contains just the Java Developement Environment 8
$ su -c "yum install java-1.8.0-openjdk-devel"

$ wget –no-cookies –no-check-certificate –header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm"

$ wget -c –header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm

curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm > jdk-8u112-linux-x64.rpm
[/code]

Platfrom – All platforms of Linux, Windows and Mac in Tar ball format

[code]
$ wget –no-check-certificate -c –header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz

$ wget –no-cookies –no-check-certificate –header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz"

$ wget -c –header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
[/code]

How to set JAVA in Linux System?

[code]
$ export JAVA_HOME=/opt/jdk1.8.0_144/
$ export PATH=/opt/jdk1.8.0_144/bin:$PATH;
[/code]

Download, Install and Configure JDK 7 & JRE 7

Platfrom – Debian & Ubuntu

[code]
#JRE7 – Package contains just the Java Runtime Environment 7
$ sudo apt-get install openjdk-7-jre

#JKD7 – Package contains just the Java Developement Environment 7
$ sudo apt-get install openjdk-7-jdk
[/code]

Platfrom – Fedora, Oracle Linux, Red Hat Enterprise Linux, etc

[code]
$ su -c “yum install java-1.7.0-openjdk”

$ su -c “yum install java-1.7.0-openjdk-devel”
[/code]

Platfrom – All platforms of Linux, Windows and Mac in Tar ball format

[code]
wget –no-cookies –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com” “http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz”

wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz

curl -v -j -k -L -H “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm > jdk-7u79-linux-x64.rpm
[/code]

JDK 6
Debian, Ubuntu, etc.
On the command line, type:
$ sudo apt-get install openjdk-6-jre
The openjdk-6-jre package contains just the Java Runtime Environment.
$ sudo apt-get install openjdk-6-jdk
If you want to develop Java programs then install the openjdk-6-jdk package.
Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c “yum install java-1.6.0-openjdk”
The java-1.6.0-openjdk package contains just the Java Runtime Environment.
$ su -c “yum install java-1.6.0-openjdk-devel”
If you want to develop Java programs then install the java-1.6.0-openjdk-devel package.