brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-dist git commit: added OS check and JAVA_HOME setup to the setenv script
Date Tue, 01 Nov 2016 15:22:54 GMT
Repository: brooklyn-dist
Updated Branches:
  refs/heads/master 058e46970 -> beac349b3


added OS check and JAVA_HOME setup to the setenv script


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/386e4d6c
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/386e4d6c
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/386e4d6c

Branch: refs/heads/master
Commit: 386e4d6ccf9e4ff16426a5ef4ee271c1f0829bef
Parents: 058e469
Author: Justin Thompson <justin.thompson@cloudsoftcorp.com>
Authored: Tue Nov 1 09:51:32 2016 +0000
Committer: Justin Thompson <justin.thompson@cloudsoftcorp.com>
Committed: Tue Nov 1 09:51:32 2016 +0000

----------------------------------------------------------------------
 .../src/main/resources/bin/setenv               | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/386e4d6c/karaf/apache-brooklyn/src/main/resources/bin/setenv
----------------------------------------------------------------------
diff --git a/karaf/apache-brooklyn/src/main/resources/bin/setenv b/karaf/apache-brooklyn/src/main/resources/bin/setenv
index 16e5c70..a0a6019 100644
--- a/karaf/apache-brooklyn/src/main/resources/bin/setenv
+++ b/karaf/apache-brooklyn/src/main/resources/bin/setenv
@@ -24,7 +24,39 @@ if [ -z "${JAVA_MAX_PERM_MEM}" ] ; then
     export JAVA_MAX_PERM_MEM="256m"
 fi
 
+# OS specific support (must be 'true' or 'false').
+    cygwin=false;
+    darwin=false;
+    aix=false;
+    os400=false;
+    case "`uname`" in
+        CYGWIN*)
+            cygwin=true
+            ;;
+        Darwin*)
+            darwin=true
+            ;;
+        AIX*)
+            aix=true
+            ;;
+        OS400*)
+            os400=true
+            ;;
+    esac
+
 # abort if java is not installed
+if $cygwin ; then
+    [ -n "$JAVA" ] && JAVA=`cygpath --unix "$JAVA"`
+    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+if [ "x$JAVA_HOME" = "x" ] && [ "$darwin" = "true" ]; then
+    JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
+fi
+if [ "x$JAVA" = "x" ] && [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+fi
+
 if [ "x$JAVA" = "x" ]; then
     if [ "x$JAVA_HOME" != "x" ]; then
         if [ ! -d "$JAVA_HOME" ]; then


Mime
View raw message