#!/bin/bash
# Auto-generated setenv.sh for JMeter JVM configuration
# This file is automatically generated and should not be manually edited
# Generated from: {{ jvm_json_path }}

# Set JAVA_HOME (always set to ensure correct JDK is used)
{% if java_home %}
export JAVA_HOME="{{ java_home }}"
# Update PATH to include JDK bin directory if not already present
if [[ ":$PATH:" != *":$JAVA_HOME/bin:"* ]]; then
    export PATH="$JAVA_HOME/bin:$PATH"
fi
{% endif %}

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

# Set GC algorithm
{% if gc_algo %}
export GC_ALGO="{{ gc_algo }}"
{% endif %}

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

