Showing posts with label jre8. Show all posts
Showing posts with label jre8. Show all posts

Tuesday, April 21, 2015

How to install OpenJDK on CentOS/RHEL

P
OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java Platform, Standard Edition (Java SE).[1] It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GNU General Public License (GNU GPL) with a linking exception. Were it not for the GPL linking exception, components that linked to the Java class library would be subject to the terms of the GPL license.

Currently, there is supported OpenJDK6, OpenJDK7, OpenJDK8. This article will show you how to install these.

Find out which version is available

[root@localhost Desktop]# yum search openjdk

Output

[root@localhost ~]# yum search openjdk
Loaded plugins: fastestmirror, refresh-packagekit, security
base                                                     | 3.7 kB     00:00
base/primary_db                                          | 3.6 MB     00:00
extras                                                   | 3.4 kB     00:00
extras/primary_db                                        |  29 kB     00:00
updates                                                  | 3.4 kB     00:00
updates/primary_db                                       | 2.6 MB     00:01
============================= N/S Matched: openjdk =============================
java-1.6.0-openjdk.i686 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.i686 : OpenJDK Demos
java-1.6.0-openjdk-devel.i686 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.i686 : OpenJDK API Documentation
java-1.6.0-openjdk-src.i686 : OpenJDK Source Bundle
java-1.7.0-openjdk.i686 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.i686 : OpenJDK Demos
java-1.7.0-openjdk-devel.i686 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.i686 : OpenJDK Source Bundle
java-1.8.0-openjdk.i686 : OpenJDK Runtime Environment
java-1.8.0-openjdk-demo.i686 : OpenJDK Demos
java-1.8.0-openjdk-devel.i686 : OpenJDK Development Environment
java-1.8.0-openjdk-headless.i686 : OpenJDK Runtime Environment
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-src.i686 : OpenJDK Source Bundle
icedtea-web.i686 : Additional Java components for OpenJDK - Java browser plug-in
                 : and Web Start implementation

  Name and summary matches only, use "search all" for everything.

Installing OpenJDK 6

In your terminal, type this command to install OpenJDK 6 and OpenJRE 6 respectively

[root@localhost Desktop]# yum install java-1.6.0-openjdk-devel java-1.6.0-openjdk

After installation finished, check your machine that has been installed OpenJDK6

[root@localhost Desktop]# java -version

Output

[root@localhost ~]# java -version
java version "1.6.0_35"
OpenJDK Runtime Environment (IcedTea6 1.13.7) (rhel-1.13.7.1.el6_6-i386)
OpenJDK Client VM (build 23.25-b01, mixed mode)
OpenJDK is installed in /usr/lib/jvm/java, therefore, you can set your JAVA_HOME with this path
# export JAVA_HOME=/usr/lib/jvm/java
Installing OpenJDK 7

Type this command to install OpenJDK 7 and OpenJRE 7 respectively

[root@localhost Desktop]# yum install java-1.7.0-openjdk-devel java-1.7.0-openjdk

After installation finished, check your machine that has been installed OpenJDK 7

[root@localhost Desktop]# java -version

Output

[root@localhost ~]# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel-2.5.5.1.el6_6-i386 u79-b14)
OpenJDK Client VM (build 24.79-b02, mixed mode, sharing)
OpenJDK is installed in /usr/lib/jvm/java, therefore, you can set your JAVA_HOME with this path
# export JAVA_HOME=/usr/lib/jvm/java
Installing OpenJDK 8

Type this command to install OpenJDK 8 and OpenJRE 8 respectively

[root@localhost Desktop]# yum install java-1.8.0-openjdk-devel java-1.8.0-openjdk

After installation finished, check your machine that has been installed OpenJDK 8

[root@localhost Desktop]# java -version

Output

[root@localhost ~]# java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK Server VM (build 25.45-b02, mixed mode)
OpenJDK is installed in /usr/lib/jvm/java, therefore, you can set your JAVA_HOME with this path
# export JAVA_HOME=/usr/lib/jvm/java

Sunday, March 29, 2015

How to install JDK 8 on CentOS

P
Installing JDK 8 is similar to JDK 7. From command line, run this for X86 machine:
[root@localhost phuongvu]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-i586.rpm

And for x64 machine:

[root@localhost phuongvu]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-x64.rpm

It takes you some minutes to download
--2015-03-29 08:48:29--  http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jd                                                                                        k-8u40-linux-i586.rpm
Resolving download.oracle.com... 23.5.165.197, 23.5.165.154
Connecting to download.oracle.com|23.5.165.197|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-                                                                                        i586.rpm [following]
--2015-03-29 08:48:29--  https://edelivery.oracle.com/otn-pub/java/jdk/8u40-b26/                                                                                        jdk-8u40-linux-i586.rpm
Resolving edelivery.oracle.com... 23.51.134.140
Connecting to edelivery.oracle.com|23.51.134.140|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-i5                                                                                        86.rpm?AuthParam=1427593831_fdd8a8bb7b24369a295a6f3b632a4412 [following]
--2015-03-29 08:48:31--  http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jd                                                                                        k-8u40-linux-i586.rpm?AuthParam=1427593831_fdd8a8bb7b24369a295a6f3b632a4412
Reusing existing connection to download.oracle.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 153976545 (147M) [application/x-redhat-package-manager]
Saving to: “jdk-8u40-linux-i586.rpm”

83% [=====================>                     ] 129,065,363  182K/s  eta 72s

Check your downloaded installer file
[root@localhost phuongvu]# ls
Desktop    Downloads                Music     Public     Videos
Documents  jdk-8u40-linux-i586.rpm  Pictures  Templates
Now, just install it
[root@localhost phuongvu]# rpm -ivh jdk-8u40-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jdk1.8.0_40            ########################################### [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...
        jfxrt.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
Check whether JDK 8 has been installed.
[root@localhost phuongvu]# java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) Client VM (build 25.40-b25, mixed mode, sharing)
Now your PC has been installed JDK 8. You can set JAVA_HOME variable by typing
[root@localhost phuongvu]# export JAVA_HOME=/usr/java/latest