diff --git a/build/build.xml b/build/build.xml index 46f46e1b..be632b2b 100644 --- a/build/build.xml +++ b/build/build.xml @@ -1,120 +1,142 @@ - - Ant build script for SDRTrunk Decoder Application - + + Ant build script for SDRTrunk Decoder Application + - - - - - - - - - - - - - - + + + + + + - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + - - - - + + + + + + + \ No newline at end of file diff --git a/scripts/run_sdrtrunk_linux.sh b/scripts/run_sdrtrunk_linux.sh index c95741eb..b0d2ff65 100755 --- a/scripts/run_sdrtrunk_linux.sh +++ b/scripts/run_sdrtrunk_linux.sh @@ -1,2 +1,16 @@ #!/bin/bash -java -XX:+UseG1GC -cp "*:libs/*" gui.SDRTrunk \ No newline at end of file + +java -version + +# Test for java version 9 +JAVA_9=$(java -version 2>&1 | grep -i version | sed 's/.* "\([9]\).*/\1/') + +if [ -z ${JAVA_9+x} ]; then + echo Using Java 9 program options + # Java 9 uses the G1 garbage collector by default and requires that we specify the + # java.xml.bind package since it's been removed from the java se core library + java -cp "*:libs/*" --add-modules java.xml.bind gui.SDRTrunk; +else + echo Using Java 8 program options + java -XX:+UseG1GC -cp "*:libs/*" gui.SDRTrunk; +fi diff --git a/scripts/run_sdrtrunk_windows.bat b/scripts/run_sdrtrunk_windows.bat index 1206e039..1c38bd44 100644 --- a/scripts/run_sdrtrunk_windows.bat +++ b/scripts/run_sdrtrunk_windows.bat @@ -1 +1,25 @@ -java -XX:+UseG1GC -cp "SDRTrunk.jar;*;libs/*;config/*;images/*" gui.SDRTrunk \ No newline at end of file +@echo off + +java -version + +SETLOCAL ENABLEDELAYEDEXPANSION + +for /f "usebackq tokens=3" %%a in (`java -version 2^>^&1 ^| find "version"`) do ( + rem set b to the unquoted version string parsed from the java version command + set b=%%~a + + rem set c to the first character of the unquoted version string + set c=!b:~0,1! + + if !c! equ 9 ( + echo Using Java 9 options + java -cp "SDRTrunk.jar;*;libs/*;config/*;images/*" --add-modules java.xml.bind gui.SDRTrunk + ) else ( + echo Using Java 8 options + java -XX:+UseG1GC -cp "SDRTrunk.jar;*;libs/*;config/*;images/*" gui.SDRTrunk + ) +) + +ENDLOCAL + +@echo on