From d608834214b70af499da2a775d55063a3b12c51f Mon Sep 17 00:00:00 2001 From: Denny Date: Mon, 9 Oct 2017 16:33:58 +0000 Subject: [PATCH] Resolves #272. Updates the windows launch script to perform conditional launching based on the JRE version 8 or 9. --- scripts/run_sdrtrunk_windows.bat | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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