forked from arduino/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharduino
executable file
·42 lines (31 loc) · 1.06 KB
/
arduino
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
#!/usr/bin/env bash
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
for LIB in \
"$APPDIR"/java/lib/rt.jar \
"$APPDIR"/java/lib/tools.jar \
"$APPDIR"/lib/*.jar \
;
do
CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH
LD_LIBRARY_PATH=$APPDIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
export JAVA_TOOL_OPTIONS=`echo $JAVA_TOOL_OPTIONS | sed 's|-javaagent:/usr/share/java/jayatanaag.jar||g'`
JAVA=java
#check systemwide java version, prefer Oracle jre
if [ -x "$(command -v java)" ]; then
SYSTEM_OPENJDK=`java -version 2>&1 | grep openjdk`
fi
if [[ -x "$APPDIR/java/bin/java" && x$SYSTEM_OPENJDK != "x" ]]; then
echo "Using bundled Java JRE"
export PATH="${APPDIR}/java/bin:${PATH}"
JAVA=$APPDIR/java/bin/java
fi
# Collect options to java in an array, to properly handle whitespace in options
JAVA_OPTIONS=("-DAPP_DIR=$APPDIR")
# Only show the splash screen when no options are present
if [[ "$@" != *"--"* ]] ; then
JAVA_OPTIONS+=("-splash:$APPDIR/lib/splash.png")
fi
"$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"