mirror of
https://github.com/void-linux/void-packages.git
synced 2025-09-27 06:05:13 +02:00
adds /usr/bin/java script to bridge the gap between fully profile-based and fully /usr/bin symlinks
11 lines
427 B
Bash
11 lines
427 B
Bash
#!/bin/sh
|
|
# allows scripts that assume java exists on PATH to work
|
|
# and helps users use java without logging out/in for the profile script
|
|
die() {
|
|
echo "java: $@" >&2
|
|
exit 1
|
|
}
|
|
. /etc/profile.d/jdk.sh
|
|
[ -d "$JAVA_HOME" ] || die "/usr/lib/jvm/default-jre not found. Check xbps-alternatives -lg java"
|
|
[ -x "$JAVA_HOME"/bin/java ] || die "$JAVA_HOME/bin/java does not exist or is not executable"
|
|
exec "$JAVA_HOME"/bin/java "$@"
|