Hi, You could set the JM_LAUNCH but this information is not used to detected the java version, so JM_LAUNCH and 'java' could have differents versions rem JM_LAUNCH - java.exe (default) or javaw.exe set JM_LAUNCH=d:\java\jdk1.7 but the java -version 2^>^&1 use the version in the PATH not the JM_LAUNCH ... for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do ( rem @echo Debug Output: %%g set JAVAVER=%%g ) Regards. Vincent D.
It's clear from the comment that JM_LAUNCH is the executable name, and does not include the PATH. Other usage is not supported/
I second this. It is usual that the JDK or JRE present in the PATH of the system is not the one used to run JMeter. And I know you can copy the jmeter.bat and modify it yourself but this can be easily fixed moving one line in the jmeter.bat file: Line 64: if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe <-- Move this to line 33 And changing this: Line 34: for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do ( To: for /f "tokens=3" %%g in ('%JM_LAUNCH% -version 2^>^&1 ^| findstr /i "version"') do ( So the new would look like: Line 33: if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe Line 34: for /f "tokens=3" %%g in ('%JM_LAUNCH% -version 2^>^&1 ^| findstr /i "version"') do ( Then you can set JM_LAUNCH to use a full path (i.e JM_LAUNCH=C:\myjdk\bin\java.exe) and it works perfectly (winxp, win7, winserver2012 at least). Is not a big deal but simplifies the execution when having multiple JDKs
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3850