From 93ba32206ba3fa77c864bdd44d687bdaf043fe24 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Sun, 17 May 2020 13:50:01 +0200 Subject: [PATCH 1/2] Prefer system-wide JRE installation if it qualifies Doing this allows us to keep bundling OpenJDK (or AdoptJDK) with all its bugs, while using the systemwide JRE (normally Oracle's) if it matches the requisites. On MacOS, these lines from appbundler should be reversed (and probably the version checked more strictly) https://github.com/arduino/appbundler/blob/ae/appbundler/native/main.m#L159-L175 --- build/linux/dist/arduino | 12 +++++++++--- build/windows/launcher/config.xml | 1 + build/windows/launcher/config_debug.xml | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/build/linux/dist/arduino b/build/linux/dist/arduino index f70c65082bf..cac08da13d4 100755 --- a/build/linux/dist/arduino +++ b/build/linux/dist/arduino @@ -15,12 +15,18 @@ export CLASSPATH LD_LIBRARY_PATH=$APPDIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH -export PATH="${APPDIR}/java/bin:${PATH}" - 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 + +#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 diff --git a/build/windows/launcher/config.xml b/build/windows/launcher/config.xml index affef023c77..1326d34d73b 100644 --- a/build/windows/launcher/config.xml +++ b/build/windows/launcher/config.xml @@ -60,6 +60,7 @@ java 32 + true -splash:"%EXEDIR%/lib/splash.png" -Dsun.java2d.d3d=false -Djna.nosys=true diff --git a/build/windows/launcher/config_debug.xml b/build/windows/launcher/config_debug.xml index 59d5a35ae0a..baca324f433 100644 --- a/build/windows/launcher/config_debug.xml +++ b/build/windows/launcher/config_debug.xml @@ -60,6 +60,7 @@ java 32 + true -Dsun.java2d.d3d=false -Djna.nosys=true -Djna.nounpack=true From 8904aba044faad636f97f195bc047c7a15714ec6 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 18 May 2020 13:00:03 +0200 Subject: [PATCH 2/2] Updated mac appbundler to 1.0.1-arduino This version will use system-wide installed JRE and fallback to bundled JRE if no system JVM is installed. --- build/build.xml | 11 ++++++----- build/macosx/appbundler-1.0.1-arduino.jar.zip.sha | 1 + build/macosx/appbundler-1.0ea-arduino5.jar.zip.sha | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 build/macosx/appbundler-1.0.1-arduino.jar.zip.sha delete mode 100644 build/macosx/appbundler-1.0ea-arduino5.jar.zip.sha diff --git a/build/build.xml b/build/build.xml index a6b480f8ff0..bcc99dc2a9b 100644 --- a/build/build.xml +++ b/build/build.xml @@ -105,6 +105,7 @@ + @@ -387,13 +388,13 @@ - - - - + + + + - +