-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathprank.sh
More file actions
executable file
·58 lines (42 loc) · 1.89 KB
/
prank.sh
File metadata and controls
executable file
·58 lines (42 loc) · 1.89 KB
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
#!/usr/bin/env bash
#
# script for running development builds in-place from this directory
#
# copy misc/local-env.sh to this directory
#
. local-env.sh
# echo JAVA_LOCALENV_PARAMS = $JAVA_LOCALENV_PARAMS
# echo PRANK_LOCALENV_PARAMS = $PRANK_LOCALENV_PARAMS
#-XX:+UseG1GC
#-XX:+UseConcMarkSweepGC
export JAVA_OPTS="$JAVA_OPTS"
export JAVA_OPTS="$JAVA_OPTS $JAVA_LOCALENV_PARAMS"
THIS_SCRIPT_DIR_REL_PATH="$( dirname "${BASH_SOURCE[0]}" )"
export POCKET_RANK_BASE_DIR="$THIS_SCRIPT_DIR_REL_PATH/distro"
if [[ "$OSTYPE" = msys* ]] ; then
PATH_SEPARATOR=';' # for win ... we want this script to run on Windows with MSYS / Git Bash
else
PATH_SEPARATOR=':' # for unix
fi
CLASSPATH="${POCKET_RANK_BASE_DIR}/bin/p2rank.jar${PATH_SEPARATOR}${POCKET_RANK_BASE_DIR}/bin/lib/*"
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
JAVACMD="$JAVA_HOME/bin/java"
else
JAVACMD="java"
fi
# JVM flags for compatibility with Java 17+
# --add-opens: required by Apache Arrow and Netty for direct memory access via sun.misc.Unsafe
# --enable-native-access: required by zstd-jni for native library loading
export JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.nio=ALL-UNNAMED"
export JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
export JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED"
export JAVA_OPTS="$JAVA_OPTS --enable-native-access=ALL-UNNAMED"
# --sun-misc-unsafe-memory-access: suppresses warnings from parquet-hadoop CleanUtil
# which uses sun.misc.Unsafe (upstream unfixed). Only available in Java 23+.
JAVA_MAJOR_VERSION=$("$JAVACMD" -version 2>&1 | head -1 | sed 's/.*"\([0-9]*\).*/\1/')
if [ "$JAVA_MAJOR_VERSION" -ge 23 ] 2>/dev/null; then
export JAVA_OPTS="$JAVA_OPTS --sun-misc-unsafe-memory-access=allow"
fi
PARAMS="$PRANK_LOCALENV_PARAMS"
"$JAVACMD" $JAVA_OPTS -cp "${CLASSPATH}" cz.siret.prank.program.Main ${PARAMS} "$@"