Showing posts with label jdk7. Show all posts
Showing posts with label jdk7. 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

Saturday, March 28, 2015

How to install JDK 7 on CentOS

P
This article will show you how to download and install JDK 7 on CentOS through command line in case your PC has been installed the no GUI version.
Step 1: Download the file installer from this server to your machine, paste below code 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/7u75-b13/jdk-7u75-linux-i586.rpm
And if your machine is x64
[root@localhost phuongvu]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u75-b13/jdk-7u75-linux-x64.rpm
OK. let have a check
[root@localhost phuongvu]# ls
Desktop    Downloads                Music     Public     Videos
Documents  jdk-7u75-linux-i586.rpm  Pictures  Templates

Step 2: Install the file you just have downloaded
[root@localhost phuongvu]# rpm -ivh jdk-7u75-linux-i586.rpm
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...
        jfxrt.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
Now, check whether JDK is installed or not
[root@localhost phuongvu]# java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) Client VM (build 24.75-b04, mixed mode, sharing)
Now your PC has been installed JDK 7. You can set JAVA_HOME variable by typing
[root@localhost phuongvu]# export JAVA_HOME=/usr/java/latest
Done.