'Setting environment variables osx 12.0.1

I need some help to set environment variables on osX 12.0.1. I tried to edit .bash_profile (it doesnt exist), .zprofile and also a pllist approach. What irritates me, is that % env is not working in Terminal. Any hints for a newbee? Any help appreciated! :)



Solution 1:[1]

You can set the environment variable in ~/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH=/opt/apache-maven-3.5.2/bin:$PATH
export PATH=$PATH:/usr/local/go/bin
export JAVA_HOME=$(/usr/libexec/java_home)

This works fine for macOS Monterey

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Programming-Lover