Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup Oracle JDK 8 for Redhat based systems using the alternatives command
#!/bin/sh
jdk=/usr/java/jdk1.8.0_05
jre=$jdk/jre
alternatives \
--install /usr/bin/java java $jre/bin/java 180005 \
--slave /usr/lib/jvm/jre jre $jre \
--slave /usr/bin/keytool keytool $jre/bin/keytool \
--slave /usr/bin/orbd orbd $jre/bin/orbd \
--slave /usr/bin/pack200 pack200 $jre/bin/pack200 \
--slave /usr/bin/rmid rmid $jre/bin/rmid \
--slave /usr/bin/rmiregistry rmiregistry $jre/bin/rmiregistry \
--slave /usr/bin/servertool servertool $jre/bin/servertool \
--slave /usr/bin/tnameserv tnameserv $jre/bin/tnameserv \
--slave /usr/bin/unpack200 unpack200 $jre/bin/unpack200 \
--slave /usr/bin/javaws javaws $jre/bin/javaws \
--slave /usr/bin/jjs jjs $jre/bin/jjs \
--slave /usr/share/man/man1/java.1 java.1 \
$jdk/man/man1/java.1 \
--slave /usr/share/man/man1/keytool.1 keytool.1 \
$jdk/man/man1/keytool.1 \
--slave /usr/share/man/man1/orbd.1 orbd.1 \
$jdk/man/man1/ordb.1 \
--slave /usr/share/man/man1/pack200.1 pack200.1 \
$jdk/man/man1/pack200.1 \
--slave /usr/share/man/man1/rmid.1 rmid.1 \
$jdk/man/man1/rmid.1 \
--slave /usr/share/man/man1/rmiregistry.1 rmiregistry.1 \
$jdk/man/man1/rmiregistry.1 \
--slave /usr/share/man/man1/servertool.1 servertool.1 \
$jdk/man/man1/servertool.1 \
--slave /usr/share/man/man1/tnameserv.1 tnameserv.1 \
$jdk/man/man1/tnameserv.1 \
--slave /usr/share/man/man1/unpack200.1 unpack200.1 \
$jdk/man/man1/unpack200.1 \
--slave /usr/share/man/man1/javaws.1 javaws.1 \
$jdk/man/man1/javaws.1 \
--slave /usr/share/man/man1/jjs.1 jjs.1 \
$jdk/man/man1/jjs.1
alternatives \
--install /usr/lib/jvm/jre-1.8.0 \
jre_1.8.0 $jre 180005 \
alternatives \
--install /usr/bin/javac javac $jdk/bin/javac 180005 \
--slave /usr/lib/jvm/java java_sdk $jdk \
--slave /usr/bin/appletviewer appletviewer $jdk/bin/appletviewer \
--slave /usr/bin/extcheck extcheck $jdk/bin/extcheck \
--slave /usr/bin/idlj idlj $jdk/bin/idlj \
--slave /usr/bin/jar jar $jdk/bin/jar \
--slave /usr/bin/jarsigner jarsigner $jdk/bin/jarsigner \
--slave /usr/bin/javadoc javadoc $jdk/bin/javadoc \
--slave /usr/bin/javafxpackager javafxpackager $jdk/bin/javafxpackager \
--slave /usr/bin/javah javah $jdk/bin/javah \
--slave /usr/bin/javap javap $jdk/bin/javap \
--slave /usr/bin/jcmd jcmd $jdk/bin/jcmd \
--slave /usr/bin/jconsole jconsole $jdk/bin/jconsole \
--slave /usr/bin/jdb jdb $jdk/bin/jdb \
--slave /usr/bin/jdeps jdeps $jdk/bin/jdeps \
--slave /usr/bin/jhat jhat $jdk/bin/jhat \
--slave /usr/bin/jinfo jinfo $jdk/bin/jinfo \
--slave /usr/bin/jmap jmap $jdk/bin/jmap \
--slave /usr/bin/jmc jmc $jdk/bin/jmc \
--slave /usr/bin/jps jps $jdk/bin/jps \
--slave /usr/bin/jrunscript jrunscript $jdk/bin/jrunscript \
--slave /usr/bin/jsadebugd jsadebugd $jdk/bin/jsadebugd \
--slave /usr/bin/jstack jstack $jdk/bin/jstack \
--slave /usr/bin/jstat jstat $jdk/bin/jstat \
--slave /usr/bin/jstatd jstatd $jdk/bin/jstatd \
--slave /usr/bin/jvisualvm jvisualvm $jdk/bin/jvisualvm \
--slave /usr/bin/native2ascii native2ascii $jdk/bin/native2ascii \
--slave /usr/bin/policytool policytool $jdk/bin/policytool \
--slave /usr/bin/rmic rmic $jdk/bin/rmic \
--slave /usr/bin/schemagen schemagen $jdk/bin/schemagen \
--slave /usr/bin/serialver serialver $jdk/bin/serialver \
--slave /usr/bin/wsgen wsgen $jdk/bin/wsgen \
--slave /usr/bin/wsimport wsimport $jdk/bin/wsimport \
--slave /usr/bin/xjc xjc $jdk/bin/xjc \
--slave /usr/share/man/man1/appletviewer.1 appletviewer.1 \
$jdk/man/man1/appletviewer.1 \
--slave /usr/share/man/man1/extcheck.1 extcheck.1 \
$jdk/man/man1/extcheck.1 \
--slave /usr/share/man/man1/idlj.1 idlj.1 \
$jdk/man/man1/idlj.1 \
--slave /usr/share/man/man1/jar.1 jar.1 \
$jdk/man/man1/jar.1 \
--slave /usr/share/man/man1/jarsigner.1 jarsigner.1 \
$jdk/man/man1/jarsigner.1 \
--slave /usr/share/man/man1/javac.1 javac.1 \
$jdk/man/man1/javac.1 \
--slave /usr/share/man/man1/javadoc.1 javadoc.1 \
$jdk/man/man1/javadoc.1 \
--slave /usr/share/man/man1/javafxpackager.1 javafxpackager.1 \
$jdk/man/man1/javafxpackager.1 \
--slave /usr/share/man/man1/javah.1 javah.1 \
$jdk/man/man1/javah.1 \
--slave /usr/share/man/man1/javap.1 javap.1 \
$jdk/man/man1/javap.1 \
--slave /usr/share/man/man1/jcmd.1 jcmd.1 \
$jdk/man/man1/jcmd.1 \
--slave /usr/share/man/man1/jconsole.1 jconsole.1 \
$jdk/man/man1/jconsole.1 \
--slave /usr/share/man/man1/jdb.1 jdb.1 \
$jdk/man/man1/jdb.1 \
--slave /usr/share/man/man1/jdeps.1 jdeps.1 \
$jdk/man/man1/jdeps.1 \
--slave /usr/share/man/man1/jhat.1 jhat.1 \
$jdk/man/man1/jhat.1 \
--slave /usr/share/man/man1/jinfo.1 jinfo.1 \
$jdk/man/man1/jinfo.1 \
--slave /usr/share/man/man1/jmap.1 jmap.1 \
$jdk/man/man1/jmap.1 \
--slave /usr/share/man/man1/jmc.1 jmc.1 \
$jdk/man/man1/jmc.1 \
--slave /usr/share/man/man1/jps.1 jps.1 \
$jdk/man/man1/jps.1 \
--slave /usr/share/man/man1/jrunscript.1 jrunscript.1 \
$jdk/man/man1/jrunscript.1 \
--slave /usr/share/man/man1/jsadebugd.1 jsadebugd.1 \
$jdk/man/man1/jsadebugd.1 \
--slave /usr/share/man/man1/jstack.1 jstack.1 \
$jdk/man/man1/jstack.1 \
--slave /usr/share/man/man1/jstat.1 jstat.1 \
$jdk/man/man1/jstat.1 \
--slave /usr/share/man/man1/jstatd.1 jstatd.1 \
$jdk/man/man1/jstatd.1 \
--slave /usr/share/man/man1/jvisualvm.1 jvisualvm.1 \
$jdk/man/man1/jvisualvm.1 \
--slave /usr/share/man/man1/native2ascii.1 native2ascii.1 \
$jdk/man/man1/native2ascii.1 \
--slave /usr/share/man/man1/policytool.1 policytool.1 \
$jdk/man/man1/policytool.1 \
--slave /usr/share/man/man1/rmic.1 rmic.1 \
$jdk/man/man1/rmic.1 \
--slave /usr/share/man/man1/schemagen.1 schemagen.1 \
$jdk/man/man1/schemagen.1 \
--slave /usr/share/man/man1/serialver.1 serialver.1 \
$jdk/man/man1/serialver.1 \
--slave /usr/share/man/man1/wsgen.1 wsgen.1 \
$jdk/man/man1/wsgen.1 \
--slave /usr/share/man/man1/wsimport.1 wsimport.1 \
$jdk/man/man1/wsimport.1 \
--slave /usr/share/man/man1/xjc.1 xjc.1 \
$jdk/man/man1/xjc.1
alternatives \
--install /usr/lib/jvm/java-1.8.0 \
java_sdk_1.8.0 $jdk 180005 \
makewhatis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.