Java Installation Process in Linux – Complete guide

java-installation-in-linux

JDK 8

Debian, Ubuntu, etc.
On the command line, type:
$ sudo apt-get install openjdk-8-jre
The openjdk-8-jre package contains just the Java Runtime Environment.
$ sudo apt-get install openjdk-8-jdk
If you want to develop Java programs then please install the openjdk-8-jdk package.
Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
The java-1.8.0-openjdk package contains just the Java Runtime Environment.
$ su -c “yum install java-1.8.0-openjdk”
If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.
$ su -c “yum install java-1.8.0-openjdk-devel “
RPM using wget
$ wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm
TAR GZ:

$ wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz

> export JAVA_HOME=/opt/jdk1.8.0_144/
>export PATH=/opt/jdk1.8.0_144/bin:$PATH
RPM using curl:
$ curl -v -j -k -L -H “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm > jdk-8u92-linux-x64.rpm

JDK 7

Debian, Ubuntu, etc.
On the command line, type:
$ sudo apt-get install openjdk-7-jre
The openjdk-7-jre package contains just the Java Runtime Environment.
$ sudo apt-get install openjdk-7-jdk
If you want to develop Java programs then install the openjdk-7-jdk package.
Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c “yum install java-1.7.0-openjdk”
The java-1.7.0-openjdk package contains just the Java Runtime Environment.
$ su -c “yum install java-1.7.0-openjdk-devel”
If you want to develop Java programs then install the java-1.7.0-openjdk-devel package.
Wget
get –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”
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
RPM using curl:
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

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.
© Tutorials
CyberChimps