Skip to content

Prefer system-wide JRE installation if compatible with shipped IDE (workaround for problems on MacOSX and external monitor) #10234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<property name="AVRDUDE-VERSION" value="6.3.0-arduino17" />
<property name="AVRCORE-VERSION" value="1.8.2" />
<property name="arduinoOTA-VERSION" value="1.3.0" />
<property name="MACOSX-APPBUNDLER-VERSION" value="1.0.1-arduino" />

<!-- Libraries required for running arduino -->
<fileset dir=".." id="runtime.jars">
Expand Down Expand Up @@ -387,13 +388,13 @@
<mkdir dir="${staging_folder}/work" />

<antcall target="unzip">
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea-arduino5.jar.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/appbundler-1.0ea-arduino5.jar.zip" />
<param name="final_folder" value="${staging_folder}/appbundler-1.0ea-arduino5" />
<param name="dest_folder" value="${staging_folder}/appbundler-1.0ea-arduino5" />
<param name="archive_file" value="${staging_folder}/appbundler-${MACOSX-APPBUNDLER-VERSION}.jar.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/appbundler-${MACOSX-APPBUNDLER-VERSION}.jar.zip" />
<param name="final_folder" value="${staging_folder}/appbundler-${MACOSX-APPBUNDLER-VERSION}" />
<param name="dest_folder" value="${staging_folder}/appbundler-${MACOSX-APPBUNDLER-VERSION}" />
</antcall>

<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-1.0ea-arduino5/appbundler-1.0ea-arduino5.jar"/>
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-${MACOSX-APPBUNDLER-VERSION}/appbundler-${MACOSX-APPBUNDLER-VERSION}.jar"/>

<bundleapp
jvmRequired="1.8"
Expand Down
12 changes: 9 additions & 3 deletions build/linux/dist/arduino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment seems confusing. This does not prefer oracle jre, AFAICS it prefers the system-wide JRE, except when its OpenJDK, then it prefers the bundled version (which is also OpenJDK IIUC, but then at least a version with known problems :-p).

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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this have an else that says "Using system Java JRE"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense

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

Expand Down
1 change: 1 addition & 0 deletions build/macosx/appbundler-1.0.1-arduino.jar.zip.sha
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5a1f9511b6b25a0ea13c94fc71964491dfe82b12
1 change: 0 additions & 1 deletion build/macosx/appbundler-1.0ea-arduino5.jar.zip.sha

This file was deleted.

1 change: 1 addition & 0 deletions build/windows/launcher/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<jre>
<path>java</path>
<runtimeBits>32</runtimeBits>
<bundledJreAsFallback>true</bundledJreAsFallback>
<opt>-splash:"%EXEDIR%/lib/splash.png"</opt>
<opt>-Dsun.java2d.d3d=false</opt>
<opt>-Djna.nosys=true</opt>
Expand Down
1 change: 1 addition & 0 deletions build/windows/launcher/config_debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<jre>
<path>java</path>
<runtimeBits>32</runtimeBits>
<bundledJreAsFallback>true</bundledJreAsFallback>
<opt>-Dsun.java2d.d3d=false</opt>
<opt>-Djna.nosys=true</opt>
<opt>-Djna.nounpack=true</opt>
Expand Down