@echo off
REM Auto-generated setenv.bat for JMeter JVM configuration
REM This file is automatically generated and should not be manually edited
REM Generated from: {{ jvm_json_path }}

REM Set JAVA_HOME (always set to ensure correct JDK is used)
{% if java_home %}
set "JAVA_HOME={{ java_home }}"
REM Update PATH to include JDK bin directory if not already present
echo %PATH% | findstr /C:"%JAVA_HOME%\bin" >nul
if errorlevel 1 (
    set "PATH=%JAVA_HOME%\bin;%PATH%"
)
{% endif %}

REM Set HEAP (initial and max heap size)
{% if heap_value %}
set "HEAP={{ heap_value }}"
{% endif %}

REM Set GC algorithm
{% if gc_algo %}
set "GC_ALGO={{ gc_algo }}"
{% endif %}

REM Set JVM_ARGS (additional JVM arguments only - heap and GC are in separate vars)
REM JMeter will combine them as: JVM_ARGS=%HEAP% %GC_ALGO% %JVM_ARGS%
{% if jvm_args_value %}
set "JVM_ARGS={{ jvm_args_value }}"
{% endif %}

