-
Notifications
You must be signed in to change notification settings - Fork 71
/
cfglocal.sh
57 lines (51 loc) · 1.22 KB
/
cfglocal.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
# Copyright (c) 2000, 2023, 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 by default uses JDK 21 and set JAVA_HOME pointing to
# that JDK version.
#
# To use a newer version locally, use command: JV=<version> ./bin/cfglocal.sh
#
# To run on RQ with a newer Java version, specify -j option as shown below
# enqueue -j <version> [-c changelist]
SCRIPT_PATH="${BASH_SOURCE[0]}"
JAVA_VERSION_TO_USE=${JV:-21}
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
if [ -e `pwd`/cfglocal.sh ]; then
SCRIPTS_DIR=`pwd`
else
SCRIPTS_DIR=`pwd`/bin
fi
else
cd `dirname $SCRIPT_PATH`
SCRIPTS_DIR=`pwd`
fi
cd - &>/dev/null
case $(uname) in
Darwin*)
. $SCRIPTS_DIR/cfgosx.sh
;;
SunOS*)
. $SCRIPTS_DIR/cfgsolaris.sh
;;
Windows*)
. $SCRIPTS_DIR/cfgwindows.sh
;;
*)
. $SCRIPTS_DIR/cfglinux.sh
;;
esac
unset JAVA_VERSION_TO_USE
unset SCRIPT_PATH
unset SCRIPTS_DIR