Thursday, July 7, 2016

Install Java 8 in Linux 64bit

Install Java 8 in Linux:

1. Before installing Java, make sure to first verify the version of installed Java.
[obiee@obiee12c oracle]$java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-2)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

It’s clear from the output above that the installed version of Java is OpenJDK 1.7.0_75.

2. Make a directory where you want to install Java. For global access (for all users) install it preferably in the directory /opt/java.
[obiee@obiee12c oracle]$ su
password
[root@obiee12c oracle]# mkdir /opt/java
[root@obiee12c oracle]# cd /opt/java

3. Now it’s time to download Java (JDK) 8u91 source tarball files for your system architecture by going to official Java download page.
For reference, we have provided the source tarball file-names, please select and download these below mentioned files only.
- jdk-8u91-linux-x64.tar.gz        [For 64-bit Systems]

[root@obiee12c oracle]# cd /opt/java
[root@obiee12c oracle]# 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/8u91-b14/jdk-8u91-linux-x64.tar.gz"

4. Once file has been downloaded, you may extract downloaded file
[root@obiee12c oracle]# tar -zxvf jdk-8u91-linux-x64.tar.gz

5. Next, move to the extracted directory and use command update-alternatives to tell system where java and its executables are installed.
[root@obiee12c oracle]# cd jdk1.8.0_91/
[root@obiee12c oracle]# update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_91/bin/java 100 
[root@obiee12c oracle]# update-alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
 + 3           /usr/java/jdk1.8.0_91/jre/bin/java

Enter to keep the current selection[+], or type selection number:

6. Tell system to update javac alternatives as:
[root@obiee12c oracle]#  update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.8.0_91/bin/javac 100
[root@obiee12c oracle]# update-alternatives --config javac

There are 2 programs which provide 'javac'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/java/jdk1.8.0_91/bin/javac
   2           /opt/java/jdk1.8.0_45/bin/javac

Enter to keep the current selection[+], or type selection number:

7. Similarly, update jar alternatives as:
[root@obiee12c oracle]# update-alternatives --install /usr/bin/jar jar /opt/java/jdk1.8.0_91/bin/jar 100
[root@obiee12c oracle]# update-alternatives --config jar

There is 1 program that provides 'jar'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/java/jdk1.8.0_91/bin/jar

Enter to keep the current selection[+], or type selection number: 1
[root@obiee12c oracle]#

8. Now You may verify the Java version again, to confirm.
[root@obiee12c oracle]# java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
[root@obiee12c oracle]#

Optional:
Setting up Java Environment Variables.

# export JAVA_HOME=/opt/java/jdk1.8.0_91/   
# export JRE_HOME=/opt/java/jdk1.8.0._91/jre    
# export PATH=$PATH:/opt/java/jdk1.8.0_91/bin:/opt/java/jdk1.8.0_91/jre/bin

If you are not using OpenJDK (open source implementation of java), you may remove it as:
# apt-get remove openjdk-*

5 comments:

yaklibber924 said...

I found your blog site on google and test a few of your early posts. Continue to maintain up the excellent operate. I simply extra up your RSS feed to my MSN News Reader. Seeking ahead to studying more from you in a while!… online casino games

Anonymous said...


Thanks, this is generally helpful.
Still, I followed step-by-step your method in this Java training
Java course

Viswa said...

Nice Post
Oracle Training in Chennai
Oracle Online Course
Oracle Training in Coimbatore

JacobHarman said...

Because of the notoriety development of IT re-appropriating Romania its rethinking market has made a significant change in the area of organizations all through the country. The capital of Romania, Bucharest, was once a selective spot for organization areas. As the IT area keeps on showing a consistent ascent, numerous Research and development focuses are focusing on college towns, like Targu Mures and Craiova, to settle in. This gives them more prominent admittance to instructed designers Romania. Youthful, spurred Romanian engineers are moving directly from college to a strong vocation in these Research and development focuses. Accordingly, and Romanian developers are profiting from these new areas beyond the nation's capital>> Mobilunity

Jack Dowson said...

Numerous organizations that work inside Spain won't recruit their own staff for programming improvement and different assignments. They will re-appropriate the errands to specialists that can play out the necessary work as and when it is required. IT nearshoring Spain is accordingly well known, particularly assuming you want a SW engineer that can communicate in the nearby language and vernacular.

Notwithstanding, there are deficiencies of abilities inside the nation so it very well may be hard to track down an organization or consultant that can give you the particular assist that you with requiring when nearshoring in Spain. This can create critical setbacks to any improvement that you might have to attempt. Something that can be unfortunate inside an area that is quick like IT>> Mobilunity