How to install Oracle JDK 8 on Ubuntu?

How to install Oracle JDK 8 on Ubuntu?

Hi,

What are the steps to install Oracle JDK 8 on Ubunut? I am installing JDK 8 on Ubuntu 14.04.

Thanks

View Answers

April 6, 2016 at 4:26 AM

Hi,

Check the video tutorial:

Thanks


April 6, 2016 at 4:31 AM

Hi,

How to install Oracle JDK 8 on Ubuntu?

In this tutorial I will show you how you can install JDK 8 from oracle on Ubuntu? This tutorial is applicable for all versios of ubuntu including 14.04 and 15.10?

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

Set Oracle Java 8 to default Java:

sudo apt-get install oracle-java8-set-default

Check the installed version of Java:

java -version

Here is full output of the process:

deepak1@deepak1-VirtualBox:~$ sudo su
[sudo] password for deepak1: 
root@deepak1-VirtualBox:/home/deepak1# sudo add-apt-repository ppa:webupd8team/java
 Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA.

More info (and Ubuntu installation instructions):
- for Oracle Java 7: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
- for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Debian installation instructions:
- Oracle Java 7: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
- Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

Important!!! For now, you should continue to use Java 8 because Oracle Java 9 is available as an early access release (it should be released in 2016)! You should only use Oracle Java 9 if you explicitly need it, because it may contain bugs and it might not include the latest security patches! Also, some Java options were removed in JDK9, so you may encounter issues with various Java apps. More information and installation instructions (Ubuntu / Linux Mint / Debian): http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html
 More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpnmgwlweq/secring.gpg' created
gpg: keyring `/tmp/tmpnmgwlweq/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpnmgwlweq/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
root@deepak1-VirtualBox:/home/deepak1# sudo apt-get update
0% [Connecting to in.archive.ubuntu.com (91.189.91.24)] [Connecting to security
Get:1 http://ppa.launchpad.net wily InRelease [15.5 kB]                        
Hit http://security.ubuntu.com wily-security InRelease                         
Get:2 http://ppa.launchpad.net wily/main amd64 Packages [3,389 B]              
Hit http://security.ubuntu.com wily-security/main Sources                      
Get:3 http://ppa.launchpad.net wily/main i386 Packages [3,389 B]               
Hit http://security.ubuntu.com wily-security/restricted Sources                
Hit http://security.ubuntu.com wily-security/universe Sources                  
Get:4 http://ppa.launchpad.net wily/main Translation-en [1,556 B]              
Hit http://in.archive.ubuntu.com wily InRelease                                
Hit http://security.ubuntu.com wily-security/multiverse Sources         
Hit http://in.archive.ubuntu.com wily-updates InRelease                 
Hit http://security.ubuntu.com wily-security/main amd64 Packages         
Hit http://in.archive.ubuntu.com wily-backports InRelease                      
Hit http://security.ubuntu.com wily-security/restricted amd64 Packages   
Hit http://security.ubuntu.com wily-security/universe amd64 Packages
Hit http://in.archive.ubuntu.com wily/main Sources             
Hit http://security.ubuntu.com wily-security/multiverse amd64 Packages
Hit http://in.archive.ubuntu.com wily/restricted Sources       
Hit http://security.ubuntu.com wily-security/main i386 Packages
Hit http://security.ubuntu.com wily-security/restricted i386 Packages          
Hit http://security.ubuntu.com wily-security/universe i386 Packages            
Hit http://security.ubuntu.com wily-security/multiverse i386 Packages          
Hit http://security.ubuntu.com wily-security/main Translation-en               
Hit http://in.archive.ubuntu.com wily/universe Sources                         
Hit http://security.ubuntu.com wily-security/multiverse Translation-en         
Hit http://security.ubuntu.com wily-security/restricted Translation-en         
Hit http://security.ubuntu.com wily-security/universe Translation-en           
Hit http://in.archive.ubuntu.com wily/multiverse Sources                       
Hit http://in.archive.ubuntu.com wily/main amd64 Packages                      
Hit http://in.archive.ubuntu.com wily/restricted amd64 Packages                
Hit http://in.archive.ubuntu.com wily/universe amd64 Packages                  
Hit http://in.archive.ubuntu.com wily/multiverse amd64 Packages                
Hit http://in.archive.ubuntu.com wily/main i386 Packages                       
Hit http://in.archive.ubuntu.com wily/restricted i386 Packages                 
Hit http://in.archive.ubuntu.com wily/universe i386 Packages                   
Hit http://in.archive.ubuntu.com wily/multiverse i386 Packages                 
Hit http://in.archive.ubuntu.com wily/main Translation-en                      
Hit http://in.archive.ubuntu.com wily/multiverse Translation-en                
Hit http://in.archive.ubuntu.com wily/restricted Translation-en                
Hit http://in.archive.ubuntu.com wily/universe Translation-en                  
Hit http://in.archive.ubuntu.com wily-updates/main Sources                     
Hit http://in.archive.ubuntu.com wily-updates/restricted Sources               
Hit http://in.archive.ubuntu.com wily-updates/universe Sources                 
Hit http://in.archive.ubuntu.com wily-updates/multiverse Sources               
Hit http://in.archive.ubuntu.com wily-updates/main amd64 Packages              
Hit http://in.archive.ubuntu.com wily-updates/restricted amd64 Packages        
Hit http://in.archive.ubuntu.com wily-updates/universe amd64 Packages          
Hit http://in.archive.ubuntu.com wily-updates/multiverse amd64 Packages        
Hit http://in.archive.ubuntu.com wily-updates/main i386 Packages               
Hit http://in.archive.ubuntu.com wily-updates/restricted i386 Packages         
Hit http://in.archive.ubuntu.com wily-updates/universe i386 Packages           
Hit http://in.archive.ubuntu.com wily-updates/multiverse i386 Packages         
Hit http://in.archive.ubuntu.com wily-updates/main Translation-en              
Hit http://in.archive.ubuntu.com wily-updates/multiverse Translation-en        
Hit http://in.archive.ubuntu.com wily-updates/restricted Translation-en        
Hit http://in.archive.ubuntu.com wily-updates/universe Translation-en          
Hit http://in.archive.ubuntu.com wily-backports/main Sources                   
Hit http://in.archive.ubuntu.com wily-backports/restricted Sources             
Hit http://in.archive.ubuntu.com wily-backports/universe Sources               
Hit http://in.archive.ubuntu.com wily-backports/multiverse Sources             
Hit http://in.archive.ubuntu.com wily-backports/main amd64 Packages            
Hit http://in.archive.ubuntu.com wily-backports/restricted amd64 Packages      
Hit http://in.archive.ubuntu.com wily-backports/universe amd64 Packages        
Hit http://in.archive.ubuntu.com wily-backports/multiverse amd64 Packages      
Hit http://in.archive.ubuntu.com wily-backports/main i386 Packages             
Hit http://in.archive.ubuntu.com wily-backports/restricted i386 Packages       
Hit http://in.archive.ubuntu.com wily-backports/universe i386 Packages         
Hit http://in.archive.ubuntu.com wily-backports/multiverse i386 Packages       
Hit http://in.archive.ubuntu.com wily-backports/main Translation-en            
Hit http://in.archive.ubuntu.com wily-backports/multiverse Translation-en      
Hit http://in.archive.ubuntu.com wily-backports/restricted Translation-en      
Hit http://in.archive.ubuntu.com wily-backports/universe Translation-en        
Fetched 23.8 kB in 33s (701 B/s)                                               
Reading package lists... Done
root@deepak1-VirtualBox:/home/deepak1# 
root@deepak1-VirtualBox:/home/deepak1# sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gsfonts-x11 java-common
Suggested packages:
  default-jre equivs binfmt-support visualvm ttf-baekmuk ttf-unfonts
  ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho
  ttf-sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
  gsfonts-x11 java-common oracle-java8-installer
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 163 kB of archives.
After this operation, 547 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu/ wily/main java-common all 0.52 [131 kB]
Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu/ wily/main oracle-java8-installer all 8u74+8u73arm-1~webupd8~1 [22.8 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ wily/main gsfonts-x11 all 0.22 [9,108 B]
Fetched 163 kB in 9s (16.7 kB/s)                                               
Preconfiguring packages ...
Selecting previously unselected package java-common.
(Reading database ... 177008 files and directories currently installed.)
Preparing to unpack .../java-common_0.52_all.deb ...
Unpacking java-common (0.52) ...
Selecting previously unselected package oracle-java8-installer.
Preparing to unpack .../oracle-java8-installer_8u74+8u73arm-1~webupd8~1_all.deb ...
Unpacking oracle-java8-installer (8u74+8u73arm-1~webupd8~1) ...
Selecting previously unselected package gsfonts-x11.
Preparing to unpack .../gsfonts-x11_0.22_all.deb ...
Unpacking gsfonts-x11 (0.22) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for doc-base (0.10.6) ...
Processing 2 added doc-base files...
Processing triggers for gnome-menus (3.13.3-6ubuntu1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu3) ...
Processing triggers for bamfdaemon (0.5.2~bzr0+15.10.20150627.1-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.58ubuntu1) ...
Processing triggers for shared-mime-info (1.3-1) ...
Processing triggers for fontconfig (2.11.1-0ubuntu6) ...
Setting up java-common (0.52) ...
Setting up oracle-java8-installer (8u74+8u73arm-1~webupd8~1) ...
Downloading Oracle Java 8...
--2016-03-25 18:29:53--  http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 23.76.157.131, 23.76.157.114
Connecting to download.oracle.com (download.oracle.com)|23.76.157.131|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.tar.gz [following]
--2016-03-25 18:29:54--  https://edelivery.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.108.90.133
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.108.90.133|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.tar.gz?AuthParam=1458910915_e1669f06aa678551783fc379a21648ee [following]
--2016-03-25 18:29:55--  http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.tar.gz?AuthParam=1458910915_e1669f06aa678551783fc379a21648ee
Connecting to download.oracle.com (download.oracle.com)|23.76.157.131|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 181302755 (173M) [application/x-gzip]
Saving to: ?jdk-8u74-linux-x64.tar.gz?

     0K ........ ........ ........ ........ ........ ........  1% 62.2K 46m35s
  3072K ........ ........ ........ ........ ........ ........  3%  119K 34m51s
  6144K ........ ........ ........ ........ ........ ........  5%  169K 28m19s
  9216K ........ ........ ........ ........ ........ ........  6%  214K 24m4s
 12288K ........ ........ ........ ........ ........ ........  8%  260K 20m58s
 15360K ........ ........ ........ ........ ........ ........ 10%  235K 19m1s
 18432K ........ ........ ........ ........ ........ ........ 12%  235K 17m33s
 21504K ........ ........ ........ ........ ........ ........ 13%  214K 16m33s
 24576K ........ ........ ........ ........ ........ ........ 15%  178K 15m58s
 27648K ........ ........ ........ ........ ........ ........ 17%  199K 15m18s
 30720K ........ ........ ........ ........ ........ ........ 19%  181K 14m49s
 33792K ........ ........ ........ ........ ........ ........ 20%  163K 14m29s
 36864K ........ ........ ........ ........ ........ ........ 22%  115K 14m36s
 39936K ........ ........ ........ ........ ........ ........ 24% 75.9K 15m21s
 43008K ........ ........ ........ ........ ........ ........ 26%  155K 14m57s
 46080K ........ ........ ........ ........ ........ ........ 27%  172K 14m27s
 49152K ........ ........ ........ ........ ........ ........ 29%  189K 13m55s
 52224K ........ ........ ........ ........ ........ ........ 31%  257K 13m16s
 55296K ........ ........ ........ ........ ........ ........ 32%  238K 12m41s
 58368K ........ ........ ........ ........ ........ ........ 34%  220K 12m11s
 61440K ........ ........ ........ ........ ........ ........ 36%  213K 11m43s
 64512K ........ ........ ........ ........ ........ ........ 38%  227K 11m14s
 67584K ........ ........ ........ ........ ........ ........ 39%  257K 10m45s
 70656K ........ ........ ........ ........ ........ ........ 41%  108K 10m40s
 73728K ........ ........ ........ ........ ........ ........ 43%  138K 10m25s
 76800K ........ ........ ........ ........ ........ ........ 45% 75.6K 10m32s
 79872K ........ ........ ........ ........ ........ ........ 46%  140K 10m15s
 82944K ........ ........ ........ ........ ........ ........ 48% 59.3K 10m28s
 86016K ........ ........ ........ ........ ........ ........ 50%  135K 10m8s
 89088K ........ ........ ........ ........ ........ ........ 52%  132K 9m49s
 92160K ........ ........ ........ ........ ........ ........ 53%  216K 9m22s
 95232K ........ ........ ........ ........ ........ ........ 55%  252K 8m53s
 98304K ........ ........ ........ ........ ........ ........ 57%  245K 8m26s
101376K ........ ........ ........ ........ ........ ........ 58%  263K 8m0s
104448K ........ ........ ........ ........ ........ ........ 60%  263K 7m34s
107520K ........ ........ ........ ........ ........ ........ 62%  259K 7m9s
110592K ........ ........ ........ ........ ........ ........ 64%  244K 6m45s
113664K ........ ........ ........ ........ ........ ........ 65%  197K 6m23s
116736K ........ ........ ........ ........ ........ ........ 67%  262K 6m0s
119808K ........ ........ ........ ........ ........ ........ 69%  264K 5m37s
122880K ........ ........ ........ ........ ........ ........ 71%  149K 5m19s
125952K ........ ........ ........ ........ ........ ........ 72%  173K 4m59s
129024K ........ ........ ........ ........ ........ ........ 74%  252K 4m38s
132096K ........ ........ ........ ........ ........ ........ 76%  228K 4m17s
135168K ........ ........ ........ ........ ........ ........ 78%  102K 4m1s
138240K ........ ........ ........ ........ ........ ........ 79%  176K 3m42s
141312K ........ ........ ........ ........ ........ ........ 81%  130K 3m24s
144384K ........ ........ ........ ........ ........ ........ 83%  241K 3m3s
147456K ........ ........ ........ ........ ........ ........ 85%  261K 2m43s
150528K ........ ........ ........ ........ ........ ........ 86%  227K 2m23s
153600K ........ ........ ........ ........ ........ ........ 88%  256K 2m4s
156672K ........ ........ ........ ........ ........ ........ 90%  259K 1m44s
159744K ........ ........ ........ ........ ........ ........ 91%  256K 85s
162816K ........ ........ ........ ........ ........ ........ 93%  189K 67s
165888K ........ ........ ........ ........ ........ ........ 95%  247K 48s
168960K ........ ........ ........ ........ ........ ........ 97%  238K 30s
172032K ........ ........ ........ ........ ........ ........ 98%  263K 11s
175104K ........ ........ ........ ......                    100%  264K=17m15s

2016-03-25 18:47:11 (171 KB/s) - ?jdk-8u74-linux-x64.tar.gz? saved [181302755/181302755]

Download done.
Removing outdated cached downloads...
update-alternatives: error: no alternatives for java
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/ControlPanel to provide /usr/bin/ControlPanel (ControlPanel) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/jcontrol to provide /usr/bin/jcontrol (jcontrol) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javafxpackager to provide /usr/bin/javafxpackager (javafxpackager) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javah to provide /usr/bin/javah (javah) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javapackager to provide /usr/bin/javapackager (javapackager) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jmc to provide /usr/bin/jmc (jmc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jvisualvm to provide /usr/bin/jvisualvm (jvisualvm) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
Oracle JDK 8 installed
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) in auto mode
Oracle JRE 8 browser plugin installed
Setting up gsfonts-x11 (0.22) ...
root@deepak1-VirtualBox:/home/deepak1# sudo apt-get install oracle-java8-set-default
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  oracle-java8-set-default
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 4,784 B of archives.
After this operation, 37.9 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/webupd8team/java/ubuntu/ wily/main oracle-java8-set-default all 8u74+8u73arm-1~webupd8~1 [4,784 B]
Fetched 4,784 B in 1s (2,455 B/s)                   
Selecting previously unselected package oracle-java8-set-default.
(Reading database ... 177119 files and directories currently installed.)
Preparing to unpack .../oracle-java8-set-default_8u74+8u73arm-1~webupd8~1_all.deb ...
Unpacking oracle-java8-set-default (8u74+8u73arm-1~webupd8~1) ...
Setting up oracle-java8-set-default (8u74+8u73arm-1~webupd8~1) ...
root@deepak1-VirtualBox:/home/deepak1# java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)
root@deepak1-VirtualBox:/home/deepak1#

Thanks


April 25, 2016 at 3:18 AM

Hi,

You can add the JAVA_HOME in system path by:

a) open .bashrc file:

vi ~/.bashrc

b) then add following code at the end of file:

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:$JAVA_HOME/bin

c) now reload the changes using following command;

source ~/.bashrc

d) To test:

echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle

Thanks









Related Tutorials/Questions & Answers:
How to install Oracle JDK 8 on Ubuntu?
How to Install Oracle Java JDK 8 in Ubuntu 16.04?
Advertisements
How to install JDK in Centos?
How to install JDK 7 in windows
How to install JDK 17 on Windows 10
How to install JDK 17 on Windows 10
How to install JDK 17 on Windows 10
How to download and install Java 8 on Windows?
download oracle jdk 11 - How to download
How to install JDK 10 in Ubuntu 18.04?
How To Install Windows 8
Installing JDK 8 on Windows 10 and configuring the settings
How to add JDK 8 support in Eclipse?
ModuleNotFoundError: No module named 'ubuntui'
How to install OpenJDK 8 in Ubuntu 18.04?
Learn the Java 8 and master the new features of JDK 8
Installing oracle Java 8 on Ubuntu 18.04
ModuleNotFoundError: No module named 'install-jdk'
install jdk 6 - Java Beginners
instruction to install oracle 10g in linux....
install jdk 6 - Java Beginners
JDK 8 - Developer Preview Released
Install JDK 10 on Windows
Oracle to release Java 8 in March 2014
How to install Ubuntu 22.04 LTS on Oracle Virtualbox?
Installing JDK 7 on Windows
Java 8: Java 8 is officially released and it can be downloaded
How to uninstall JDK from Ubuntu 16.04?
JDK 8 Release Candidates Available
How to uninstall JDK 7?
How to download JDK source code?
how to download oracle 9i
jdk
Installing JDK 9 on Windows 10
How about 2+5+"8"?
how to find jdk path in ubuntu?
How to Create a Different User Account in Windows 8?
How to install Ubuntu 16.04 LTS?
Java 8 expected release date
how to install jboss drools
How to download and install Tomcat?
How to install cocoapods in Max?
how to install bower with anaconda
how to install jboss - EJB
how to install jfreechart in netbeans.
how to install tensorflow 2.1.0
how to install tensorflow 2.1.0
how to install tensorflow 2.0.1
how to install tensorflow 2.0.1
How to install ffmpeg on Windows?

Ads