projects/aports·blob master · refs

28 lines · 705 B

1#!/bin/sh
2
3# create symlink for the active jvm
4cd /usr/lib/jvm
5
6# the link "forced-jvm" is created by an user to explicitly use a specific jvm
7if [ -x forced-jvm ]; then
8 ln -sfn forced-jvm default-jvm
9else
10 # if no "forced-jvm" is present, then the latest installed version is taken
11 LATEST=`ls -d java-*/bin/java | sort -Vr | head -1 | cut -d/ -f1`
12 if [ "$LATEST" ]; then
13 ln -sfn $LATEST default-jvm
14 fi
15fi
16
17# clean up dangling symlinks
18for link in $(find -L /usr/bin -type l -print); do
19 case "$(readlink $link)" in ../lib/jvm/*)
20 rm "$link"
21 ;;
22 esac
23done
24
25# create program links for the currently active jre
26cd /usr/bin
27find ../lib/jvm/default-jvm/bin -mindepth 1 -type f -exec ln -sfn {} . \;
28