From a031cc00f02fcd0b3c5f91fb0900a41f4f2c0960 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 21 Nov 2012 13:51:31 +0100 Subject: [PATCH] profile.d/env.sh: add jre and jdk bin dirs to PATH if respective components are installed --- profile.d/env.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/profile.d/env.sh b/profile.d/env.sh index 5c3667b..d95bd56 100644 --- a/profile.d/env.sh +++ b/profile.d/env.sh @@ -1,3 +1,9 @@ -[ -x /usr/lib/jvm/jre/bin/java ] && JAVA_HOME=/usr/lib/jvm/jre -[ -x /usr/lib/jvm/jdk/bin/javac ] && JAVA_HOME=/usr/lib/jvm/jdk -[ "$JAVA_HOME" ] && export JAVA_HOME +[ -x /usr/lib/jvm/jre/bin/java ] && { + JAVA_HOME=/usr/lib/jvm/jre + 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