CLOUDSTACK-6926 setting java_home from installed java

changed the order of preference to check for java first.

Usage server rpm installs JRE 1.7. In the case where JDK 1.6 is already
installed, java version would be 1.7 but, javac would be 1.6
If javac is given preference, usage server fails to start in this case.
This commit is contained in:
Rajani Karuturi 2014-09-12 14:56:48 +05:30
parent 283666b038
commit fa1156092e
2 changed files with 8 additions and 8 deletions

View File

@ -52,12 +52,12 @@ setJavaHome() {
return return
fi fi
# try javac first # try java first
java=$(which javac 2>/dev/null || :) java=$(which java 2>/dev/null || :)
# try java if javac is not found # try javac if java is not found
if [ -z "$java" ] ; then if [ -z "$java" ] ; then
java=$(which java 2>/dev/null || :) java=$(which javac 2>/dev/null || :)
fi fi
if [ -n "$java" ] ; then if [ -n "$java" ] ; then

View File

@ -48,12 +48,12 @@ setJavaHome() {
return return
fi fi
# try javac first # try java first
java=$(which javac 2>/dev/null || :) java=$(which java 2>/dev/null || :)
# try java if javac is not found # try javac if java is not found
if [ -z "$java" ] ; then if [ -z "$java" ] ; then
java=$(which java 2>/dev/null || :) java=$(which javac 2>/dev/null || :)
fi fi
if [ -n "$java" ] ; then if [ -n "$java" ] ; then