Skip to content

Instantly share code, notes, and snippets.

@ryanobjc
Created July 16, 2012 21:22
Show Gist options
  • Save ryanobjc/3125148 to your computer and use it in GitHub Desktop.
Save ryanobjc/3125148 to your computer and use it in GitHub Desktop.
#!/bin/sh
VERS=$1
cat > java-post.sh <<EOF
#!/bin/sh
set -e
for i in java javac jps jstack jmap ; do
update-alternatives --install /usr/bin/\$i \$i /usr/lib/jvm/$VERS/bin/\$i 1
done
ln -sf /usr/lib/jvm/$VERS /usr/lib/jvm/default-java
ln -sf /usr/lib/jvm/$VERS /usr/lib/jvm/java-6-sun
exit 0
EOF
chmod +x java-post.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment