jMAVSim: try new libs with newer Java versions

This is an attempt to get jMAVSim to run with Java9+.
This commit is contained in:
Julian Oes 2020-05-07 09:03:54 +02:00 committed by Nuno Marques
parent 03e51076b0
commit aea94ff57b
2 changed files with 2 additions and 26 deletions

@ -1 +1 @@
Subproject commit eb62cd2766358a19490c1314f7eddf0391407d62
Subproject commit 14ce7868fb29b8b05cdecf4e9a76b318839302e9

View File

@ -56,31 +56,7 @@ if [ "$HEADLESS" = "1" ]; then
extra_args="$extra_args -no-gui"
fi
# jMAVSim crashes with Java 9 on macOS, therefore we need to use Java 8
if [ "$(uname)" == "Darwin" ]; then
bold=$(tput bold)
normal=$(tput sgr0)
if ! /usr/libexec/java_home -V 2>&1 | grep --quiet "1.8\|Java SE 8" ; then
echo "${bold}You need to have Java 8 installed for macOS, for more info, see:${normal}"
echo "${bold}https://dev.px4.io/master/en/simulation/jmavsim.html#macos${normal}"
exit 1
fi
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
elif [ "$(uname)" == "Linux" ]; then
if ! java -version 2>&1 | grep --quiet "1.8" ; then
echo "${bold}You need to use Java 8, for more info, see:${normal}"
echo "${bold}https://dev.px4.io/master/en/simulation/jmavsim.html#ubuntu${normal}"
exit 1
fi
fi
ant create_run_jar copy_res
cd out/production
java -XX:GCTimeRatio=20 -Djava.ext.dirs= -Djavax.accessibility.assistive_technologies=" " -jar jmavsim_run.jar $device $extra_args
ret=$?
if [ $ret -ne 0 -a $ret -ne 130 ]; then # 130 is Ctrl-C
# if the start of java fails, it's probably because the GC option is not
# understood. Try starting without it
java -Djava.ext.dirs= -Djavax.accessibility.assistive_technologies=" " -jar jmavsim_run.jar $device $extra_args
fi
java -XX:GCTimeRatio=20 -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args