Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions build/linux/dist/arduino
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"

for LIB in \
$APPDIR/java/lib/rt.jar \
$APPDIR/java/lib/tools.jar \
$APPDIR/lib/*.jar \
"$APPDIR"/java/lib/rt.jar \
"$APPDIR"/java/lib/tools.jar \
"$APPDIR"/lib/*.jar \
;
do
CLASSPATH="${CLASSPATH}:${LIB}"
Expand All @@ -17,18 +17,19 @@ export LD_LIBRARY_PATH

export PATH="${APPDIR}/java/bin:${PATH}"

if [[ "$@" == *"--upload"* || "$@" == *"--verify"* || "$@" == *"--get-pref"* || "$@" == *"--install-board"* || "$@" == *"--install-library"* ]] ; then
SPLASH=""
else
SPLASH="-splash:$APPDIR/lib/splash.png"
fi

export JAVA_TOOL_OPTIONS=`echo $JAVA_TOOL_OPTIONS | sed 's|-javaagent:/usr/share/java/jayatanaag.jar||g'`

JAVA=java
if [ -x $APPDIR/java/bin/java ]; then
if [ -x "$APPDIR/java/bin/java" ]; then
JAVA=$APPDIR/java/bin/java
fi

$JAVA -DAPP_DIR="$APPDIR" -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base "$@"
# Collect options to java in an array, to properly handle whitespace in options
JAVA_OPTIONS=("-DAPP_DIR=$APPDIR" "-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel")

if [[ "$@" != *"--upload"* && "$@" != *"--verify"* && "$@" != *"--get-pref"* && "$@" != *"--install-board"* && "$@" != *"--install-library"* ]] ; then
JAVA_OPTIONS+=("-splash:$APPDIR/lib/splash.png")
fi

$JAVA "${JAVA_OPTIONS[@]}" processing.app.Base "$@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable JAVA can be obtained from:

JAVA=$APPDIR/java/bin/java

when the if on line 24 is followed and, since APPDIR may contain spaces, the last line should be changed to:

"$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"

(adding quotes to the $JAVA call), do you agree?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, agreed! Will you change it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we go a6602ca