Skip to content

Instantly share code, notes, and snippets.

@deepankarb
Created August 31, 2017 08:59
Show Gist options
  • Save deepankarb/5d2b138a76472d2e5e5e5bbc667127cb to your computer and use it in GitHub Desktop.
Save deepankarb/5d2b138a76472d2e5e5e5bbc667127cb to your computer and use it in GitHub Desktop.
Removes *all* JDK altgernatives.
if [ -z "$1" ]
then
echo "Please specify JDK path"
exit 1
fi
JDK_PATH="$1"
JDK_APPS=( $() )
for app in `find "$JDK_PATH/bin" -type f -executable`
do
app_name=$(basename $app)
man="$app_name"".1"
man_alt="$JDK_PATH""/man/man1/""$man"
man_path="/usr/share/man/man1/$man"
update-alternatives --remove-all "$app_name"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment