0% found this document useful (0 votes)
149 views17 pages

Install Oracle Java 6, 7, or 8 in Ubuntu 14

This article describes how to install Oracle Java 6, 7, or 8 in Ubuntu 14.04 using a PPA repository. The user adds the PPA, updates package lists, and installs the desired Java version by running a command in the terminal. Java's default version can also be set. Installing Java allows users to run Java applications and development in Ubuntu.

Uploaded by

Alex Florea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
149 views17 pages

Install Oracle Java 6, 7, or 8 in Ubuntu 14

This article describes how to install Oracle Java 6, 7, or 8 in Ubuntu 14.04 using a PPA repository. The user adds the PPA, updates package lists, and installs the desired Java version by running a command in the terminal. Java's default version can also be set. Installing Java allows users to run Java applications and development in Ubuntu.

Uploaded by

Alex Florea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

(https://plus.google.

com/105318999106266025664)
(https://plus.google.com/105318999106266025664)
(https://plus.google.com/105318999106266025664)
(https://plus.google.com/105318999106266025664)

UbuntuHandbook(http://ubuntuhandbook.org/)
News,Tutorials,HowtosforUbuntuLinux

(h
tt
p:
//f
ee
ds
.f
ee
db
ur
ne
r.
co
m
(h /U
tt bu
p: nt
//f uh
ac an
eb (h db
oo tt oo
k. ps k
co :// N
m (h pl e
/p tt us w
ag ps .g sT (h
es :// oo ut tt
/U la gl or p:
bu un e. ial //t
nt ch co s wi
uh pa m H tte
an d. /1 o r.
db ne 05 wt co
oo t/ 31 os m
k/ ~ 89 F /U
35 ub 99 or bu
27 un 10 U nt
69 tu 62 bu u
63 ha 66 nt H
48 nd 02 u an
26 bo 56 Li db
37 ok 64 nu oo
9) 1) ) x) k)

Search...

RecentPosts
Home(http://ubuntuhandbook.org) /
Howtos(http://ubuntuhandbook.org/index.php/category/howtos/) / Install&SetupHarmattanConky
InstallOracleJava6,7,or8inUbuntu14.04Trusty ThemeinUbuntuDesktop
(http://ubuntuhandbook.org/index.p
hp/2017/05/installsetupharmattan
conkythemeinubuntudesktop/)
InstallOracleJava6,7, InstallBrightnessControllerUtilityin

or8inUbuntu14.04 Ubuntu16.04&Higher
(http://ubuntuhandbook.org/index.p
hp/2017/05/installbrightness
Trusty controllerutilityinubuntu1604
higher/)
February28,2014
InstallChattyTwitchChatClientin
Ubuntu16.04,17.04
(http://ubuntuhandbook.org/index.p
hp/2017/05/installchattytwitch
chatclientinubuntu16041704/)

HowtoInstallEnlightenment0.21.8
inUbuntu16.04,17.04
(http://ubuntuhandbook.org/index.p
hp/2017/05/installenlightenment0
218inubuntu16041704/)

VLC2.2.6Releasedwith3Bugs
Fixed[HowtoInstall]
(http://ubuntuhandbook.org/index.p
hp/2017/05/vlc226releasedwith
3bugsfixed/)

PopularPosts

3WaystoCreateWifiHotspotin
Ubuntu14.04(AndroidSupport)
(http://ubuntuhandbook.org/index.p
hp/2014/09/3wayscreatewifi
hotspotubuntu/)22Sep,2014

ShareInternetConnectionWith
AndroidinUbuntu14.04
(http://ubuntuhandbook.org/index.p
hp/2014/06/shareinternetwith
androidubuntu1404/)08Jun,
2014

Skype4.3Released,HowtoInstall
(http://ubuntuhandbook.org/wp itinUbuntu14.04/12.04
content/uploads/2014/02/oracle_java_icons_logo.png) (http://ubuntuhandbook.org/index.p
hp/2014/06/skype43installin
ThissimpletutorialisgoingtoshowyouhowtoeasilyinstallOracle ubuntu1404/)19Jun,2014
Java(JDK)6,7,or8inUbuntu14.04TrustyTahrviaPPA. QuickTip:InstallAdobeReaderin
Ubuntu14.04Trusty
TheresaLaunchpadPPA(PersonalPackageArchive)maintained (http://ubuntuhandbook.org/index.p
bywebupd8.org,apopularUbuntuLinuxblog,whichprovidesthe hp/2014/04/installadobereader
mostrecentinstallerstoautomaticallydownloadandinstall ubuntu1404/)26Apr,2014
OracleJavaJDK6/JDK7/JDK8fromoraclewebsite.Note
InstallGoogleSketchUpMake2014
therearenoactualJavafilesinthisPPA. inUbuntu14.04
(http://ubuntuhandbook.org/index.p
Togetstarted: hp/2014/06/installgooglesketchup
ubuntu1404/)02Jun,2014
PressCtrl+Alt+Tonyourkeyboardtoopenaterminalwindow.
Whenitopens,copyandpastethecommandbelowandhitenter.
InputyouruserpasswordwhenpromptsanditwilladdthePPA RelatedPosts
repositoryintoyoursystem.
[QuickTip]EnableTelnetServicein
Ubuntu14.04
sudoaddaptrepositoryppa:webupd8team/java
(http://ubuntuhandbook.org/index.p
hp/2014/12/enabletelnetubuntu
Afterthat,updatepackagelistsvia: 1404/)

HowtoSpeedUptheUnityDash
sudoaptgetupdate ResponseinUbuntu14.04/14.10
(http://ubuntuhandbook.org/index.p
ToinstallOracleJava8,run: hp/2014/11/speedupunitydash
responseubuntu/)

sudoaptgetinstalloraclejava8installer RawTherapee4.2Released,How
toinstallitinUbuntu14.04
(http://ubuntuhandbook.org/index.p
Changethenumber8to6(or7)inthecodetoinstallJava6(or7).
hp/2014/10/rawtherapee42
releasedinstallinubuntu1404/)
Whileinstallation,youllbeaskedtoagreethelicenseandthenthe
installerstartdownloadingJavafilefromoraclewebsiteandinstall
itonyoursystem.

TosetthedefaultJava,run:

sudoaptgetinstalloraclejava8setdefault

Alsochangenumber8totheJavaversionyouwant.

FinallycheckwhethereverytingisOK:

javaversion

Itwilloutputsomethinglikebelow:

javaversion1.7.0_60
Java(TM)SERuntimeEnvironment(build1.7.0_60b19)
JavaHotSpot(TM)64BitServerVM(build24.60b09,mixed
mode)

Tweet

Recommend 35

13

Share 2
InHowtos(http://ubuntuhandbook.org/index.php/category/howtos/) Install
OracleJavaUbuntu(http://ubuntuhandbook.org/index.php/tag/installoracle
javaubuntu/),Ubuntu14.04(http://ubuntuhandbook.org/index.php/tag/ubuntu
1404/)
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava67or8
ubuntu1404/)

Jim
(http://ubuntuhandbook.org/index.php/about/)

I'mafreelancebloggerwhostartedusingUbuntu
5+yearsagoandwishestosharemyexperiences
andsomeusefultipswithUbuntubeginnersandlovers.Pleasenotify
meifyoufindanytypo/grammar/languagemistakes.Englishisnot
mynativelanguage.ContactmeonGooglePlus
(https://plus.google.com/105318999106266025664?rel=author)or
[email protected]
(mailto:[email protected]?Subject=Hello%20again)

InstalldigiKam4.0Beta3in...
(http://ubuntuhandbook.org/index.php/2014/02/installdigikam40
beta3inubuntu1310saucy/)

Ubuntu14.04Beta1Builds...
(http://ubuntuhandbook.org/index.php/2014/02/ubuntu1404beta1
availabledownload/)

RecentComments

35responsestoInstallOracleJava6, kartiqueonGIMP2.8.20Available
7,or8inUbuntu14.04Trusty inPPAforUbuntu16.10,16.04,
14.04,12.04
nagarFebruary28,2014at2:22pm (http://ubuntuhandbook.org/index.p
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6 hp/2017/02/gimp2820available
7or8ubuntu1404/#comment161973) inppa/#comment3664560)

Goodjobbro:) AndrewonInstallBrightness
ControllerUtilityinUbuntu16.04&
Higher
(http://ubuntuhandbook.org/index.p
psy444opsMarch3,2014at8:07pm hp/2017/05/installbrightness
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6 controllerutilityinubuntu1604
7or8ubuntu1404/#comment167208) higher/#comment3664559)
somethinggonnebadinstallingJava8,itwontfinishthe JanDevriesonHowtoCreateA
updatewhenirun: BootableUbuntu16.10USBStick
sudoaptgetinstalloraclejava8installer (http://ubuntuhandbook.org/index.p
soican`tupdatemy14.04itgivesmejustpartial hp/2016/10/createabootable
upgrade ubuntu1610usbstick/#comment
3664558)
canyouhelp,Thankyouinadvanceandkindregards
BatdenonHowtoInstall
Enlightenment0.21.8inUbuntu
16.04,17.04
QadeemQureshiMarch11,2014at12:57am
(http://ubuntuhandbook.org/index.p
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
hp/2017/05/installenlightenment0
java67or8ubuntu1404/#comment197792)
218inubuntu160417
Haveyoutriedscrollingdownididthatandfoundoutit 04/#comment3664557)
wasdone!
JarosawBugajskionHowtoInstall
Enlightenment0.21.8inUbuntu
16.04,17.04
MikeBurkeApril4,2014at3:57pm (http://ubuntuhandbook.org/index.p
(http://ubuntuhandbook.org/index.php/2014/02/installoracle hp/2017/05/installenlightenment0
java67or8ubuntu1404/#comment350425)
218inubuntu160417
04/#comment3664555)
Lookslikesomedependenciesarebrokenwiththe
latestupdatestryingtoinstallviaaptgives:
Thefollowingpackageswillbe
REMOVED:
aptapturlnautilussharepython
softwarepropertiespython3software
propertiessoftwarecentersoftware
propertiescommonsoftwareproperties
gtkubuntudesktopubuntuextras
keyringubuntuminimalunattended
upgrades
ThefollowingNEWpackageswillbe
installed:
oraclejava8installer

StleApril4,2014at5:03pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment350667)

Seemsthatthistriestoremoveaptformeon14.04:
Suggestedpackages:
binfmtsupportvisualvmttfbaekmukttfunfontsttf
unfontscorettfkochigothicttfsazanamigothic
ttfkochiminchottfsazanamiminchottfarphicuming
ThefollowingpackageswillbeREMOVED:
aptapturlnautilussharepgdgkeyringpostgresql9.1
postgresqlclient9.1postgresqlclientcommon
postgresqlcommonpython3softwareproperties
softwarecentersoftwarepropertiescommon
softwarepropertiesgtktaskseltaskseldataubuntu
desktopubuntuextraskeyringubuntuminimal
unattendedupgrades
ThefollowingNEWpackageswillbeinstalled:
oraclejava8installer
WARNING:Thefollowingessentialpackageswillbe
removed.
ThisshouldNOTbedoneunlessyouknowexactlywhat
youaredoing!
apt

ScottDeaganApril6,2014at1:39am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment357147)

Idontthinkthiswillworkwith14.04(currentlyinbeta).
Followingtheinstructionsabove,Igetthis:

ThefollowingpackageswillbeREMOVED
aptapturlnautilussharepython3softwareproperties
softwarecentersoftwarepropertiescommon
softwarepropertiesgtkubuntudesktopubuntuextras
keyringubuntuminimalunattendedupgrades

Inotherwords,itwoulduninstalltheUbuntudesktop!

EzraShirstiApril6,2014at6:09am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment357811)

ThefollowingpackageswillbeREMOVED:
aptapturlnautilussharepython3softwareproperties
softwarecentersoftwarepropertiescommon
softwarepropertiesgtkubuntudesktopubuntuextras
keyringubuntuminimalunattendedupgrades

ThispackageappearstodestoyUbuntu14.04?

JimApril6,2014at1:36pm
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment358890)
Thanksguys.IvereportthisissuetothePPA
maintainer.Therewillbeanupdatesoon.

AlbertoApril8,2014at9:21pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment369168)

Now,itworksfineinUbuntu14.04,thanks:)

RicardoMay9,2014at5:48am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment475116)

Hello,

ihaveinstalleditseverealtimes,butihavetouninstalled
it,andicedtec.Becausealltimesjavawasblockedornot
workingproperly.

niuGuangzheFebruary27,2016at11:39am
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment3473384)

imaymeetthesameproblemthesituationisthati
cancompilingtheprocedure,wheniusetheorder_
javaanditdoestwork,thereasoniscannotfindthe
mainclassXXXX,butwhenidothesameworkon
windows7,itsoktoaccomplishtheprocedure,soithink
theproblemis$JAVA_HOME,becauseWhenIwas
checkjavainstallationdirectoryifindthatihavenolimit
toinsidethedirectorynowitstillnotwork.
MargoMay14,2014at8:38am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment492438)

Verythoroughandaccuratemanual(14.04).Theveryfirst
timejavawasntapaininstalling.Thankyou.

JonasJune19,2014at2:18pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment590807)

sudoaptgetinstalloraclejava7installer

Triedthison14.04,butIamgetting:

Thefollowingpackageshaveunmetdependencies:
oraclejava7installer:Depends:javacommon(>=0.24)
butitisnotgoingtobeinstalled
Recommends:gsfontsx11butitisnotgoingtobe
installed

JimJune20,2014at4:07am
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment592219)

Seemsthatyouhavebrokenpackages.Try:

sudoaptgetupdate

sudoaptgetfinstall

Findoutwhatisbrokenandfixit.
JeanVictorCtJuly19,2015at7:05pm
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment3256298)

Ihadthesameproblem,includingthesameproblem
withbinutils,andtriedthetwolinesthatyou
provided,tonoavail.Isitpossiblethatthe64bit
versionisnotyetready?

YOUNGJune30,2014at7:10am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment618651)

HowcanIselectivelyinstall32bitJDK?Givencommand
installs64bitJDK.
P.S.ImtryingtodevelopanAndroidappandIwastold
toinstall32bitJDK.

PeopalioJuly11,2014at10:00pm
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment651180)

Ithinkitautomaticallydetectsyourarch.becauseI
haveusedthiscommandona64bitTrustyandam
installingitona32bitPreciseasItype.

ddkJuly28,2014at12:48pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment708012)

HiJim,

Imnewbeeforubuntu..
Imusingubuntu14.04LTSandiwanttoinstalljava6u21
inthis.

Howtoinstallexactversionandupdateonly..

JimJuly28,2014at2:10pm
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment708205)

Firstitshighlyrecommendedtoinstallthelatest
stableversionasitiscompatiblewitholderversions.If
anapplicationorwebpageyouaccessrequiresan
olderversionofJava,youshouldreportthistothe
provider/developerandrequestthattheyupdatethe
applicationtobecompatiblewithallJavaversions.

Second,ifyoureallywantthejava6u21,youcan
downloadtheofficialinstallerfromTHISPAGE
(http://www.oracle.com/technetwork/java/javase/downl
oads/javaarchivedownloadsjavase6419409.html).

32bitsystemdownloadthejre6u21linux
i586.bin
64bitsystemdownloadthejre6u21linux
x64.bin
Oncedownloaded,pressCtrl+Alt+Tonkeyboardto
opentheterminalanddo:

1.GototheDownloadsfolderandgiveexecutable
permission:

cd~/Downloads/&&chmodu+xjre6u21linux*.
bin

2.Runtheinstaller:

./jre6u21linux*.bin
3.Movetheinstallationto/usr/lib/jvm:

sudomvjdk1.6.0_21/usr/lib/jvm/

If/usr/lib/jvmisnotexist,createitby:

sudomkdirp/usr/lib/jvm

4.Tomakeitdefault(dependsonOStype,youmay
changei386toamd64):

sudoupdatealternativesinstall"/usr/bin/j
ava""java""/usr/lib/jvm/jdk1.6.0_21/bin/jav
a"1
sudoupdatealternativesinstall"/usr/bin/j
avac""javac""/usr/lib/jvm/jdk1.6.0_21/bin/ja
vac"1
sudoupdatealternativesinstall"/usr/lib/m
ozilla/plugins/libjavaplugin.so""mozillajava
plugin.so""/usr/lib/jvm/jdk1.6.0_21/jre/lib/i
386/libnpjp2.so"1

RanTalbottJuly8,2016at7:28am
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment3544967)

Onmy14.04system,thepluginsarein
/usr/lib/firefoxaddons/pluginsnot
/usr/lib/mozila/pluginssoIhadtochangetheupdate
alternativescommand.

Thanksforpostingthatinfo:itsavedmesometime
becauseIbailedoutofthewebupd8softwarewhen
itinsistedonredownloadingtheinstallpackagethat
Idalreadydownloadedandinstalled.Withoutit,I
wouldhaveneededtodoothersearchingtofindout
whatIneededtodotofinishtheinstall.

ddkAugust4,2014at6:13am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment739615)

Great:)Jim..,

Thestepyouprovideitlooksgreatanditperfectfor
UbuntuNewbeelikeme.

Thankslotforyoursupport

mohanAugust23,2014at4:44am
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment847193)

thankslottoyoursimplestepstoinstalljavainubuntu.It
madetosavelottime.

GerardSeptember17,2014at8:13pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment1038690)

Great,itsworking!Pleaseconsidertheonestepmorein
youttutorial,tocheckwhethereverytingisOK.Ihave
used:
javaversion
Andtheoutput:
javaversion1.8.0_20
Java(TM)SERuntimeEnvironment(build1.8.0_20b26)
JavaHotSpot(TM)ServerVM(build25.20b23,mixed
mode)
NtGDecember3,2014at5:21pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment2076486)

CannotaddPPA:ppa:webupd8team/java.
PleasecheckthatthePPAnameorformatiscorrect.

Pleasetellmehowtosolvethiserror

JimDecember4,2014at11:03am
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment2085273)

Trybelowstepstofixtheissue:

1.Makesureyourenotbehindproxy.
2.Runcommand:

sudoaptgetinstallreinstallcacertificat
es

3.UsebelowcommandinsteadtoaddthePPA:

sudoEaddaptrepositoryppa:webupd8team/jav
a

SamMay25,2015at5:13am
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment3159659)

Ihadfollowyourinstructionbutstillhavingthe
problem.
wrongmanDecember20,2014at6:26pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment2277380)

32bitJDKinstructionsareneededhere.

prathabJanuary18,2015at2:22pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment2588568)

Howtoplaymoviesinubuntu???

JimJanuary18,2015at3:26pm
(http://ubuntuhandbook.org/index.php/2014/02/installoracle
java67or8ubuntu1404/#comment2588904)

OpenUbuntuSoftwareCenter,searchforandinstall
ubunturestrictedextrasallowsyoutowatchvideo
filesincommonformatsviathedefaultMoviePlayer.
OryoucansearchforandinstallVLCvideoplayer.

Napalm99February1,2015at4:27pm
(http://ubuntuhandbook.org/index.php/2014/02/installoraclejava6
7or8ubuntu1404/#comment2683010)

heydude.iknowthatitsnottherightplaceatall,butive
seenyourlinksmostoftheplaceswhilesurfing.sincei
didntgotanywhereimaskingmyquestionhere.Howto
viewmyandroidscreeninmyubuntu14.04LTS64bit.as
itolditsnotarightplacetoaskbutsomeothertutorials
tellthatuhavetogetthelatestjavaonyoursystemand
doblablabla.ijustrootedmyphoneandithasno
problemastherearemanyappslikedroidvnc,

You might also like