Skip to content

Instantly share code, notes, and snippets.

@deors
Created November 24, 2019 19:21
Show Gist options
  • Save deors/fc93f14e4795502dab712f8abc2be678 to your computer and use it in GitHub Desktop.
Save deors/fc93f14e4795502dab712f8abc2be678 to your computer and use it in GitHub Desktop.
#!/bin/sh
JAVA_DIR=$1
JAVA_BIN_DIR=$JAVA_DIR/bin
DEST_DIR=/usr/bin
ALT_LEVEL=$2
for f in `find $JAVA_BIN_DIR -maxdepth 1 -type f -executable`
do
NAME=`basename $f`
echo installing alternative for $JAVA_BIN_DIR/$NAME in $DEST_DIR/$NAME
update-alternatives --install $DEST_DIR/$NAME $NAME $JAVA_BIN_DIR/$NAME $ALT_LEVEL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment