[英]How to add the Java Path as an environment variable bash_profile on Mac
Here is how my bash_profile looks:这是我的 bash_profile 的外观:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/henilshelat/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/henilshelat/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/henilshelat/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/henilshelat/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
enter image description here And here is the location of my Java_Home: /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
在此处输入图像描述这是我的 Java_Home 的位置:
/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
How and where do I update the path to Java_home?如何以及在哪里更新 Java_home 的路径?
In .bash_profile you just have to insert在.bash_profile你只需要插入
export JAVA_HOME=$(/usr/libexec/java_home)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.