From 452faa220c453c00218ec5ad89bd70d8ffaa88c2 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 20 May 2016 15:25:45 -0400 Subject: [PATCH] Filter client/server VM options from jvm.options The default jvm.options file ships with the -server flag to force the server VM on systems where the server VM is not the default. However, the method of starting the JVM via the Windows service does not support the command-line flags for selecting the VM because it starts from a DLL that is specific to the server or client VM. Thus, we need to filter these options from the jvm.options configuration file when installing the Windows service. Relates #18473 --- distribution/src/main/resources/bin/service.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/src/main/resources/bin/service.bat b/distribution/src/main/resources/bin/service.bat index 3d73c37b823..81b6c8a5df5 100644 --- a/distribution/src/main/resources/bin/service.bat +++ b/distribution/src/main/resources/bin/service.bat @@ -163,7 +163,7 @@ set ES_JVM_OPTIONS="%ES_HOME%\config\jvm.options" if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;% @setlocal -for /F "usebackq delims=" %%a in (`findstr /b \- "%ES_JVM_OPTIONS%"`) do set JVM_OPTIONS=!JVM_OPTIONS!%%a; +for /F "usebackq delims=" %%a in (`findstr /b \- "%ES_JVM_OPTIONS%" ^| findstr /b /v "\-server \-client"`) do set JVM_OPTIONS=!JVM_OPTIONS!%%a; @endlocal & set ES_JAVA_OPTS=%JVM_OPTIONS%%ES_JAVA_OPTS% if "%ES_JAVA_OPTS:~-1%"==";" set ES_JAVA_OPTS=%ES_JAVA_OPTS:~0,-1%