From 733e73e1856c29bf910ff7ada99a91e3fcf9b2b2 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 30 Jan 2020 14:48:30 +0100 Subject: [PATCH] Tools: check for Java 8 on Linux This allows us to print an error message instead of a weird Java failure further down the road. Better yet would be if this would take down everything, so a user does not have to scroll up to read the message. --- Tools/jmavsim_run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tools/jmavsim_run.sh b/Tools/jmavsim_run.sh index 0bd68d5ebd..6c41609c78 100755 --- a/Tools/jmavsim_run.sh +++ b/Tools/jmavsim_run.sh @@ -66,6 +66,12 @@ if [ "$(uname)" == "Darwin" ]; then 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