From c7a83b1f8e98d8326981d1d0e45694deeee28b34 Mon Sep 17 00:00:00 2001 From: Andrea Antonello Date: Thu, 18 Feb 2021 16:22:28 +0100 Subject: [PATCH] add unix java path check --- extras/deploy/hm-dbviewer.sh | 9 ++++++++- extras/deploy/hm-geopaparazzi_viewer.sh | 10 +++++++++- extras/deploy/hm-geoscript.sh | 9 ++++++++- extras/deploy/hm-gforms.sh | 9 ++++++++- extras/deploy/hm-h2gis-server-start.sh | 9 ++++++++- extras/deploy/hm-h2gis-tcpserver-stop.sh | 9 ++++++++- extras/deploy/hm-lasviewer.sh | 10 +++++++++- extras/deploy/hm-mapcalc.sh | 10 +++++++++- extras/deploy/hm-quickfolder.sh | 10 +++++++++- extras/deploy/hm-settings.sh | 10 +++++++++- extras/deploy/hm-simplenww-viewer.sh | 10 +++++++++- extras/deploy/hm-sld.sh | 10 +++++++++- extras/deploy/hm-spatialtoolbox.sh | 10 +++++++++- extras/deploy/hm-utils-ssh.sh | 10 +++++++++- extras/deploy/hm-wms2geotiff.sh | 10 +++++++++- 15 files changed, 130 insertions(+), 15 deletions(-) diff --git a/extras/deploy/hm-dbviewer.sh b/extras/deploy/hm-dbviewer.sh index 28ccd9d89..8df68b15b 100755 --- a/extras/deploy/hm-dbviewer.sh +++ b/extras/deploy/hm-dbviewer.sh @@ -21,4 +21,11 @@ MEM="-Xmx4g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR=`dirname "$0"` -java -splash:$DIR/imgs/splash_dbviewer.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.database.DatabaseViewer $1 + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + +"$JAVAEXE" -splash:$DIR/imgs/splash_dbviewer.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.database.DatabaseViewer $1 diff --git a/extras/deploy/hm-geopaparazzi_viewer.sh b/extras/deploy/hm-geopaparazzi_viewer.sh index 9c282805c..3632ab29f 100755 --- a/extras/deploy/hm-geopaparazzi_viewer.sh +++ b/extras/deploy/hm-geopaparazzi_viewer.sh @@ -20,4 +20,12 @@ MEM="-Xmx2g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -java -splash:$DIR/imgs/splash_geopaparazziviewer.png $MEM -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.geopaparazzi.GeopaparazziViewer + + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + +"$JAVAEXE" -splash:$DIR/imgs/splash_geopaparazziviewer.png $MEM -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.geopaparazzi.GeopaparazziViewer diff --git a/extras/deploy/hm-geoscript.sh b/extras/deploy/hm-geoscript.sh index 3d477e95f..c53cc650b 100755 --- a/extras/deploy/hm-geoscript.sh +++ b/extras/deploy/hm-geoscript.sh @@ -27,4 +27,11 @@ then SPLASH=-splash:$DIR/imgs/splash_geoscript.png fi -java $SPLASH $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.geoscript.GeoscriptConsole $1 +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $SPLASH $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.geoscript.GeoscriptConsole $1 diff --git a/extras/deploy/hm-gforms.sh b/extras/deploy/hm-gforms.sh index 687eeee47..b87130a9c 100755 --- a/extras/deploy/hm-gforms.sh +++ b/extras/deploy/hm-gforms.sh @@ -20,4 +20,11 @@ MEM="-Xmx256m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR=`dirname "$0"` -java -splash:$DIR/imgs/splash_gforms.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gforms.FormBuilderController $1 +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" -splash:$DIR/imgs/splash_gforms.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gforms.FormBuilderController $1 diff --git a/extras/deploy/hm-h2gis-server-start.sh b/extras/deploy/hm-h2gis-server-start.sh index 97d316072..d690f44fb 100755 --- a/extras/deploy/hm-h2gis-server-start.sh +++ b/extras/deploy/hm-h2gis-server-start.sh @@ -24,4 +24,11 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # possible options are: # port=9432 # type=web -java $MEM -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.dbs.h2gis.H2GisServer $1 $2 +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.dbs.h2gis.H2GisServer $1 $2 diff --git a/extras/deploy/hm-h2gis-tcpserver-stop.sh b/extras/deploy/hm-h2gis-tcpserver-stop.sh index 2221de9d9..7fdadd4ff 100755 --- a/extras/deploy/hm-h2gis-tcpserver-stop.sh +++ b/extras/deploy/hm-h2gis-tcpserver-stop.sh @@ -22,4 +22,11 @@ MEM="-Xmx4g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # the necessary argument is the port of the running server -java $MEM -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.h2.tools.Server -tcpShutdown tcp://localhost:$1 +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.h2.tools.Server -tcpShutdown tcp://localhost:$1 diff --git a/extras/deploy/hm-lasviewer.sh b/extras/deploy/hm-lasviewer.sh index a01e1402b..d5f7e97e5 100755 --- a/extras/deploy/hm-lasviewer.sh +++ b/extras/deploy/hm-lasviewer.sh @@ -20,4 +20,12 @@ MEM="-Xmx4g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR=`dirname "$0"` -java -splash:$DIR/imgs/splash_lasviewer.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.lidar.LasInfoController $1 + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" -splash:$DIR/imgs/splash_lasviewer.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.lidar.LasInfoController $1 diff --git a/extras/deploy/hm-mapcalc.sh b/extras/deploy/hm-mapcalc.sh index b2c6a1835..f7f012890 100755 --- a/extras/deploy/hm-mapcalc.sh +++ b/extras/deploy/hm-mapcalc.sh @@ -20,4 +20,12 @@ MEM="-Xmx1g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -java $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.mapcalc.MapcalcController + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.mapcalc.MapcalcController diff --git a/extras/deploy/hm-quickfolder.sh b/extras/deploy/hm-quickfolder.sh index edb0a8482..8703c7bc3 100755 --- a/extras/deploy/hm-quickfolder.sh +++ b/extras/deploy/hm-quickfolder.sh @@ -21,4 +21,12 @@ MEM="-Xmx4g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR=`dirname "$0"` -java $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gui.utils.HMMapframe $@ + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gui.utils.HMMapframe $@ diff --git a/extras/deploy/hm-settings.sh b/extras/deploy/hm-settings.sh index 20bb7ca6b..b16c5fd4e 100755 --- a/extras/deploy/hm-settings.sh +++ b/extras/deploy/hm-settings.sh @@ -21,4 +21,12 @@ MEM="-Xmx256m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR=`dirname "$0"` -java -splash:$DIR/imgs/splash_settings.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gui.settings.SettingsController + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" -splash:$DIR/imgs/splash_settings.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gui.settings.SettingsController diff --git a/extras/deploy/hm-simplenww-viewer.sh b/extras/deploy/hm-simplenww-viewer.sh index 6d7973e24..ff6ad466e 100755 --- a/extras/deploy/hm-simplenww-viewer.sh +++ b/extras/deploy/hm-simplenww-viewer.sh @@ -20,4 +20,12 @@ MEM="-Xmx2g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -java $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.nww.SimpleNwwViewer + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.nww.SimpleNwwViewer diff --git a/extras/deploy/hm-sld.sh b/extras/deploy/hm-sld.sh index 951e92ecf..082853ec2 100755 --- a/extras/deploy/hm-sld.sh +++ b/extras/deploy/hm-sld.sh @@ -20,4 +20,12 @@ MEM="-Xmx4g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR=`dirname "$0"` -java -splash:$DIR/imgs/splash_sld.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.style.MainController $1 + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" -splash:$DIR/imgs/splash_sld.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.style.MainController $1 diff --git a/extras/deploy/hm-spatialtoolbox.sh b/extras/deploy/hm-spatialtoolbox.sh index a136b0239..456cc5197 100755 --- a/extras/deploy/hm-spatialtoolbox.sh +++ b/extras/deploy/hm-spatialtoolbox.sh @@ -20,4 +20,12 @@ MEM="-Xmx1g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -java -splash:$DIR/imgs/splash_spatialtoolbox.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.gui.spatialtoolbox.SpatialtoolboxController $DIR/libs + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" -splash:$DIR/imgs/splash_spatialtoolbox.png $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -Djava.library.path=$DIR/natives/ -cp "$DIR/libs/*" org.hortonmachine.gui.spatialtoolbox.SpatialtoolboxController $DIR/libs diff --git a/extras/deploy/hm-utils-ssh.sh b/extras/deploy/hm-utils-ssh.sh index ead7d972a..afc554cec 100755 --- a/extras/deploy/hm-utils-ssh.sh +++ b/extras/deploy/hm-utils-ssh.sh @@ -20,4 +20,12 @@ MEM="-Xmx256m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -java $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gui.utils.SshTesterController + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.gui.utils.SshTesterController diff --git a/extras/deploy/hm-wms2geotiff.sh b/extras/deploy/hm-wms2geotiff.sh index b3a0aa0c9..6441dbeee 100755 --- a/extras/deploy/hm-wms2geotiff.sh +++ b/extras/deploy/hm-wms2geotiff.sh @@ -20,4 +20,12 @@ MEM="-Xmx4g" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -java $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.webmaps.WebMapsController + +if [ -f "$DIR/jre/bin/java" ]; then + JAVAEXE=$DIR/jre/bin/java +else + JAVAEXE=java +fi + + +"$JAVAEXE" $MEM -Djava.util.logging.config.file=$DIR/quiet-logging.properties -cp "$DIR/libs/*" org.hortonmachine.webmaps.WebMapsController