forked from oracle/coherence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfglinux.sh
58 lines (48 loc) · 1.37 KB
/
cfglinux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Copyright (c) 2000, 2022, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.
# This script sets all environment variables necessary to build Coherence.
#
# Command line:
# . ./cfglinux.sh [-reset]
#
# see cfgcommon.sh
#
# Global Variables
# The platform specific command used to locate the correct version of java
# Note: this command is evaluated when required
_JAVA_HOME_CMD="get_java_home"
function get_java_home
{
if [ -d /usr/java/jdk$_VERSION_REQUIRED ]; then
echo "/usr/java/jdk$_VERSION_REQUIRED"
elif [ -d /usr/local/packages/jdk8 ]; then
echo "/usr/local/packages/jdk8"
fi
}
# determine the scripts directory, assuming all scripts are in the same directory
SCRIPT_PATH="${BASH_SOURCE[0]}"
while [ -h "${SCRIPT_PATH}" ]; do
LS=`ls -ld "${SCRIPT_PATH}"`
LINK=`expr "${LS}" : '.*-> \(.*\)$'`
if [ `expr "${LINK}" : '/.*'` > /dev/null ]; then
SCRIPT_PATH="${LINK}"
else
SCRIPT_PATH="`dirname "${SCRIPT_PATH}"`/${LINK}"
fi
done
if [ -z "$SCRIPT_PATH" ]; then
SCRIPTS_DIR=`pwd`/bin
else
cd `dirname $SCRIPT_PATH`
SCRIPTS_DIR=`pwd`
fi
cd - &>/dev/null
if [ -f $SCRIPTS_DIR/../tools/internal/bin/cfglinux.sh ]; then
source $SCRIPTS_DIR/../tools/internal/bin/cfglinux.sh
fi
source $SCRIPTS_DIR/cfgcommon.sh
unset SCRIPT_PATH
unset SCRIPTS_DIR