Академический Документы
Профессиональный Документы
Культура Документы
BlogsHome
Products&Services
Downloads
Support
Partners
Communities
About
Login
OracleBlog
JeffTaylor'sWeblog
JeffTaylor'sWeblog
EnterpriseManager...|Main
JAVA_HOMEonSolaris11
ByJeffTaylorOracleonNov23,2014
IrecentlyassertedthatitisnotagoodideatosettheJAVA_HOMEenvironmentvariableto/usr/javaon
Solaris11.Instead,I'drecommendsomethinglikethis:
$exportJAVA_HOME=/usr/jdk/instances/jdk1.7.0
Why?Becauseitisn'tclearwhere/usr/javawillpointtoovertime.Herearesomedetails.Workingwith
Solaris11:
$cat/etc/release
OracleSolaris11.2SPARC
Copyright(c)1983,2014,Oracleand/oritsaffiliates.Allrightsreserved.
Assembled23June2014
#pkginfoentire|grep//
FMRI:pkg://solaris/entire@0.5.11,5.110.175.2.0.0.42.0:20140624T193832Z
Atfirstglance,itseemsthat/usr/javaisasymboliclinktoJDK1.7:
$lsl/usr/java
lrwxrwxrwx1rootroot15Aug1808:02/usr/java>jdk/jdk1.7.0_60
Butoncloserexamination,itisn'tafullJDK.Noticethatjconsole,jps,etcaremissing:
$ls/usr/java/bin
ControlPaneljcontrolpack200rmiregistrytnameserv
javakeytoolpolicytoolservertoolunpack200
javawsorbdrmidsparcv9
InstallingthefullJDKiseasy:
$sudopkginstallacceptjdk7
AndnowtherestoftheexpectedJDKprogramsarepresent:
$ls/usr/java/bin
appletviewerjavahjmapnative2asciiservertool
extcheckjavapjpsorbdsparcv9
idljjcmdjrunscriptpack200tnameserv
jarjconsolejsadebugdpolicytoolunpack200
jarsignerjdbjstackrmicwsgen
javajdepsjstatrmidwsimport
javarmi.cgijhatjstatdrmiregistryxjc
javacjinfojvisualvmschemagen
javadocjjskeytoolserialver
Notethat/usr/javaisasymboliclink,toasecondsymboliclink,whichlinkstoadirectory:
$lsld/usr/java
lrwxrwxrwx1rootroot15Aug1808:02/usr/java>jdk/jdk1.7.0_60
Followingsymboliclink1:
$lsld/usr/jdk/jdk1.7.0_60
lrwxrwxrwx1rootroot18Aug1808:02/usr/jdk/jdk1.7.0_60>
instances/jdk1.7.0
Followingsymboliclink2:
$lsld/usr/jdk/instances/jdk1.7.0/
drwxrxrx6rootbin7Aug1808:02/usr/jdk/instances/jdk1.7.0/
Butifyouinstalljdk8,thelinkschange:
$lsld/usr/java
lrwxrwxrwx1rootroot15Nov2113:08/usr/java>jdk/jdk1.8.0_20
$lsld/usr/jdk/jdk1.8.0_20
lrwxrwxrwx1rootroot18Nov2113:08/usr/jdk/jdk1.8.0_20>
instances/jdk1.8.0
SoifyourJAVA_HOMEwassetto/usr/java,yourapplicationwouldstartusingJDK8.
$exportJAVA_HOME=/usr/java
$$JAVA_HOME/bin/javaversion
javaversion"1.8.0_20"
Java(TM)SERuntimeEnvironment(build1.8.0_20b26)
JavaHotSpot(TM)64BitServerVM(build25.20b23,mixedmode)
Itisinterestingthat,incontrast,whenyouinstallJDK6andJDK7isalreadyinstalled,the/usr/java
linkswillcontinuetopointtotheJDKwiththehighermajorversion.
MyadviceisthatifyourapplicationiscertifiedwithJDK7,andyou'dliketheuserstoautomatically
pickupthenewestbugfixesandsecurityupdates,thisisthesafestbet.
$exportJAVA_HOME=/usr/jdk/instances/jdk1.7.0
Hopethishelps.
Category:Sun
Tags:java
Permanentlinktothisentry
EnterpriseManager...|Main
Comments:
Bydefault,thelinkwillpointtothehighestversionnumberofJavainstalledviatheIPSpackaging
system,butsiteswhichwantadifferentdefaultcanchangeitviathe'pkgsetmediator'commandas
showninhttps://docs.oracle.com/cd/E36784_01/html/E36802/gnztu.html.
PostedbyAlanCoopersmithonNovember24,2014at05:50PMEST#
HiAlan,
Thanksforthepointerto'pkgsetmediator'
Itlookslikethefunctionalityisverysimilarto"/usr/sbin/alternativesconfigjava"and
"/usr/sbin/updatealternativesconfigjava"availableinsomeLinuxdistributionssuchasRedHatand
Ubuntu.
IlikethatSolarissetstheentireJavadefaultbundleinoneshot.WiththeLinuxalternativesmethod,
therearetoomanywaystomixandmatch,forexample,defaultjavafrom1.7butdefaultjavacfrom1.8.
Iwonderhowmanyinstallationsbenefitfromthatmuchflexibilityvs.howmanyinstallationsare
unintentionallymisconfigured.
Jeff
PostedbyJeffonNovember25,2014at01:00PMEST#
PostaComment:
Name: guest
EMail:
URL:
Notifymebyemailofnewcomments
RememberInformation?
YourComment:
HTMLSyntax:NOTallowed
Pleaseanswerthissimplemathquestion
9+68=
Preview
Post
About
JeffTaylorOracle
Search
Entersearchterm:
Searchonlythisblog
RecentPosts
JAVA_HOMEonSolaris11
EnterpriseManageragentTZRegion
OnionSecurity
netperfonSolaris11
emcaandORA12537:TNS:connectionclosed
InstallingVNCserveronSolaris11
QuadraticProgrammingwithOracleREnterprise
SPARCT54LDomsforRACandWebLogicClusters
VNCCut&PasteonSolaris10
UsingRtoanalyzeJavaG1garbagecollectorlogfiles
TopTags
&
11
analytics
analyze
awr
bigdata
cc
containers
cut
datamining
enterprise
files
for
g1
g1gc
garbage
gc
hadoop
hive
java
jvm
ldom
log
manager
mos
nehalem
nehelemep
oaa
on
oracle12c
ore
ovm
paste
patches
quadprog
r
rac
recommended
redo
solaris
solaris11
sparc
studio
tns
tuning
virtualization
vnc
windchill
wls
zones
Categories
Analytics
Database
PTCWindchill
Personal
Sun
Archives
December2014
Sun Mon Tue Wed Thu Fri Sat
1
2 3
4 5 6
7 8
9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Today
Bookmarks
vReality,OrgadKimchi
Menu
BlogsHome
Weblog
Login
Feeds
RSS
All
/Analytics
/Database
/PTCWindchill
/Personal
/Sun
Comments
Atom
All
/Analytics
/Database
/PTCWindchill
/Personal
/Sun
Comments
Theviewsexpressedonthisblogarethoseoftheauthoranddonotnecessarilyreflecttheviewsof
Oracle.TermsofUse|YourPrivacyRights|CookiePreferences