Created
November 24, 2019 19:21
-
-
Save deors/fc93f14e4795502dab712f8abc2be678 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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