profile.d/env.sh: add jre and jdk bin dirs to PATH if respective components are installed

This commit is contained in:
Silvan Calarco 2012-11-21 13:51:31 +01:00
parent a85245097d
commit a031cc00f0

View File

@ -1,3 +1,9 @@
[ -x /usr/lib/jvm/jre/bin/java ] && JAVA_HOME=/usr/lib/jvm/jre [ -x /usr/lib/jvm/jre/bin/java ] && {
[ -x /usr/lib/jvm/jdk/bin/javac ] && JAVA_HOME=/usr/lib/jvm/jdk JAVA_HOME=/usr/lib/jvm/jre
[ "$JAVA_HOME" ] && export JAVA_HOME PATH=$PATH:/usr/lib/jvm/jre/bin
}
[ -x /usr/lib/jvm/jdk/bin/javac ] && {
JAVA_HOME=/usr/lib/jvm/jdk
PATH=$PATH:/usr/lib/jvm/jdk/bin
}
[ "$JAVA_HOME" ] && export JAVA_HOME PATH