You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/07/29 14:35:57 UTC

svn commit: r1366831 - /karaf/trunk/wrapper/core/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-service

Author: jbonofre
Date: Sun Jul 29 12:35:56 2012
New Revision: 1366831

URL: http://svn.apache.org/viewvc?rev=1366831&view=rev
Log:
[KARAF-1683] Add fallback to JRE if JDK not found in the wrapper

Modified:
    karaf/trunk/wrapper/core/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-service

Modified: karaf/trunk/wrapper/core/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-service
URL: http://svn.apache.org/viewvc/karaf/trunk/wrapper/core/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-service?rev=1366831&r1=1366830&r2=1366831&view=diff
==============================================================================
--- karaf/trunk/wrapper/core/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-service (original)
+++ karaf/trunk/wrapper/core/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-service Sun Jul 29 12:35:56 2012
@@ -17,8 +17,11 @@
 # limitations under the License.
 # ------------------------------------------------------------------------
 
-# JAVA_HOME
-[ -x /bin/readlink ] && [ -z $JAVA_HOME ] && export JAVA_HOME=$(/bin/readlink -f /usr/bin/javac | sed "s:/bin/javac::")
+# JAVA_HOME, trying the JDK first and fallback to JRE
+if [ -x readlink ]; then
+  [ -z $JAVA_HOME ] && export JAVA_HOME="$(readlink -f /usr/bin/javac | sed 's:/bin/javac::')"
+  [ -z $JAVA_HOME ] && export JAVA_HOME="$(readlink -f /usr/bin/java | sed 's:/bin/java::')"
+fi
 
 # Application
 APP_NAME="${name}"