Skip to content

Commit

Permalink
IGNITE-11216 Ignite.sh fails on Mac OS and Linux - Java 11 (apache#6061)
Browse files Browse the repository at this point in the history
  • Loading branch information
vveider authored and DirectXceriD committed Mar 6, 2019
1 parent da765c4 commit 9930b0c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
18 changes: 12 additions & 6 deletions bin/ignite.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
set -o errtrace
set -o functrace

#
# GridGain Community Edition Licensing
# Copyright 2019 GridGain Systems, Inc.
Expand Down Expand Up @@ -40,7 +46,7 @@
#
# Import common functions.
#
if [ "${IGNITE_HOME}" = "" ];
if [ "${IGNITE_HOME:-}" = "" ];
then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
else IGNITE_HOME_TMP=${IGNITE_HOME};
fi
Expand All @@ -62,7 +68,7 @@ checkJava
#
setIgniteHome

if [ "${DEFAULT_CONFIG}" == "" ]; then
if [ "${DEFAULT_CONFIG:-}" == "" ]; then
DEFAULT_CONFIG=config/default-config.xml
fi

Expand Down Expand Up @@ -97,7 +103,7 @@ fi
# Mac OS specific support to display correct name in the dock.
osname=`uname`

if [ "${DOCK_OPTS}" == "" ]; then
if [ "${DOCK_OPTS:-}" == "" ]; then
DOCK_OPTS="-Xdock:name=Ignite Node"
fi

Expand Down Expand Up @@ -151,7 +157,7 @@ fi
#
# Set main class to start service (grid node by default).
#
if [ "${MAIN_CLASS}" = "" ]; then
if [ "${MAIN_CLASS:-}" = "" ]; then
MAIN_CLASS=org.apache.ignite.startup.cmdline.CommandLineStartup
fi

Expand All @@ -164,7 +170,7 @@ fi
#
# Final JVM_OPTS for Java 9+ compatibility
#
javaMajorVersion "${JAVA_HOME}/bin/java"
javaMajorVersion "${JAVA}"

if [ $version -eq 8 ] ; then
JVM_OPTS="\
Expand Down
10 changes: 8 additions & 2 deletions bin/include/functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
set -o errtrace
set -o functrace

#
# GridGain Community Edition Licensing
# Copyright 2019 GridGain Systems, Inc.
Expand Down Expand Up @@ -113,7 +119,7 @@ setIgniteHome() {
#
# Set IGNITE_HOME, if needed.
#
if [ "${IGNITE_HOME}" = "" ]; then
if [ "${IGNITE_HOME:-}" = "" ]; then
export IGNITE_HOME=${IGNITE_HOME_TMP}
fi

Expand Down
18 changes: 17 additions & 1 deletion bin/include/parseargs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
set -o errtrace
set -o functrace

#
# GridGain Community Edition Licensing
# Copyright 2019 GridGain Systems, Inc.
Expand Down Expand Up @@ -68,3 +74,13 @@ do
esac
shift
done

#
# Set 'file.encoding' to UTF-8 default if not specified otherwise
#
case "${JVM_OPTS:-}" in
*-Dfile.encoding=*)
;;
*)
JVM_OPTS="${JVM_OPTS:-} -Dfile.encoding=UTF-8";;
esac
16 changes: 11 additions & 5 deletions bin/include/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
set -o errtrace
set -o functrace

#
# GridGain Community Edition Licensing
# Copyright 2019 GridGain Systems, Inc.
Expand Down Expand Up @@ -44,7 +50,7 @@
#
# Check IGNITE_HOME.
#
if [ "${IGNITE_HOME}" = "" ]; then
if [ "${IGNITE_HOME:-}" = "" ]; then
echo $0", ERROR: Ignite installation folder is not found."
echo "Please create IGNITE_HOME variable pointing to location of"
echo "Ignite installation folder."
Expand Down Expand Up @@ -79,12 +85,12 @@ IFS=$(echo -en "\n\b")
for file in ${IGNITE_HOME}/libs/*
do
if [ -d ${file} ] && [ "${file}" != "${IGNITE_HOME}"/libs/optional ]; then
IGNITE_LIBS=${IGNITE_LIBS}${SEP}${file}/*
IGNITE_LIBS=${IGNITE_LIBS:-}${SEP}${file}/*
fi
done

IFS=$SAVEIFS

if [ "${USER_LIBS}" != "" ]; then
IGNITE_LIBS=${USER_LIBS}${SEP}${IGNITE_LIBS}
if [ "${USER_LIBS:-}" != "" ]; then
IGNITE_LIBS=${USER_LIBS:-}${SEP}${IGNITE_LIBS}
fi

0 comments on commit 9930b0c

Please sign in to comment.