Skip to content

Instantly share code, notes, and snippets.

@codeslinger
Created June 20, 2010 16:22
Show Gist options
  • Save codeslinger/445930 to your computer and use it in GitHub Desktop.
Save codeslinger/445930 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
priority=2
basedir=/usr/lib/jvm/jdk1.7.0
basediralias=/usr/lib/jvm/jdk1.7.0
mandir=/usr/lib/jvm/jdk1.7.0/man
jdiralias=jdk1.7.0
srcext=1.gz
dstext=1.gz
jdk_tools='appletviewer apt extcheck idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc'
jre_tools='javaws policytool'
for i in $jdk_tools; do
unset slave1 slave2 || true
if [ -e $mandir/man1/$i.$srcext ]; then
slave1="--slave /usr/share/man/man1/$i.$dstext $i.$dstext $mandir/man1/$i.$srcext"
fi
update-alternatives --install /usr/bin/$i $i $basediralias/bin/$i $priority $slave1 $slave2
done
mandir=/usr/lib/jvm/jdk1.7.0/jre/man
for i in $jre_tools; do
unset slave1 slave2 || true
if [ -e $mandir/man1/$i.$srcext ]; then
slave1="--slave /usr/share/man/man1/$i.$dstext $i.$dstext $mandir/man1/$i.$srcext"
fi
update-alternatives --install /usr/bin/$i $i $basediralias/jre/bin/$i $priority $slave1 $slave2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment