Skip to content

Instantly share code, notes, and snippets.

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