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 dspavlov committed Feb 11, 2019
1 parent 816f435 commit 12bd7cd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 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

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -23,7 +29,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 @@ -45,7 +51,7 @@ checkJava
#
setIgniteHome

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

Expand Down Expand Up @@ -80,7 +86,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 @@ -134,7 +140,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 @@ -147,7 +153,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

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -96,7 +102,7 @@ setIgniteHome() {
#
# Set IGNITE_HOME, if needed.
#
if [ "${IGNITE_HOME}" = "" ]; then
if [ "${IGNITE_HOME:-}" = "" ]; then
export IGNITE_HOME=${IGNITE_HOME_TMP}
fi

Expand Down
12 changes: 9 additions & 3 deletions 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

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -55,9 +61,9 @@ done
#
# Set 'file.encoding' to UTF-8 default if not specified otherwise
#
case "${JVM_OPTS}" in
case "${JVM_OPTS:-}" in
*-Dfile.encoding=*)
;;
*)
JVM_OPTS="${JVM_OPTS} -Dfile.encoding=UTF-8";;
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

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -27,7 +33,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 @@ -62,12 +68,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 12bd7cd

Please sign in to comment.