Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BE976200BB4 for ; Tue, 1 Nov 2016 16:22:55 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BD1B4160B02; Tue, 1 Nov 2016 15:22:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0DE31160AF7 for ; Tue, 1 Nov 2016 16:22:54 +0100 (CET) Received: (qmail 13265 invoked by uid 500); 1 Nov 2016 15:22:54 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 13253 invoked by uid 99); 1 Nov 2016 15:22:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2016 15:22:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 09250E1772; Tue, 1 Nov 2016 15:22:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: svet@apache.org To: commits@brooklyn.apache.org Date: Tue, 01 Nov 2016 15:22:54 -0000 Message-Id: <2cec931dfda24ffba426428ba5592150@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] brooklyn-dist git commit: added OS check and JAVA_HOME setup to the setenv script archived-at: Tue, 01 Nov 2016 15:22:55 -0000 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 Authored: Tue Nov 1 09:51:32 2016 +0000 Committer: Justin Thompson 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