# Fish Java Environment Switch - {{env_name}}
# Generated by fnva

# Clean previous fnva-managed path, then set new JAVA_HOME
if set -q FNVA_JAVA_BIN
    set -gx PATH (string match -v "^$FNVA_JAVA_BIN\$" $PATH)
end
set -gx FNVA_JAVA_BIN "{{java_bin}}"
set -gx JAVA_HOME "{{java_home}}"
set -gx PATH "{{java_bin}}" $PATH

# Set fnva environment tracking
set -gx FNVA_CURRENT_JAVA "{{env_name}}"
set -gx FNVA_ENV_TYPE "Java"

# Verify the switch
if not set -q _FNVA_QUIET
    printf '\033[32m✓\033[0m Switched to Java: {{env_name}}\n'
end
