无法在Catalina上设置JAVA_HOME [英] Can't set JAVA_HOME on Catalina
问题描述
我使用卡塔琳娜州.我创建了.bash_profile
文件并对其进行了编辑.
I use Catalina. I created the .bash_profile
file and edited it.
我在此文件中写了export JAVA_HOME=$(/usr/libexec/java_home)
并键入source ~/.bash_profile
,然后键入echo $JAVA_HOME
并显示了路径,但是当我重新打开终端并键入echo $JAVA_HOME
时,不再显示该路径.
I wrote export JAVA_HOME=$(/usr/libexec/java_home)
in this file and typed source ~/.bash_profile
, after that typed echo $JAVA_HOME
and showed the path but when I reopen the terminal and type echo $JAVA_HOME
, doesn't show the path again.
出什么问题了?
推荐答案
Catalina中的新用户帐户默认使用zsh
,而不是bash
.您需要在~/.zprofile
而不是~/.bash_profile
中设置环境.
New user accounts in Catalina default to using zsh
, not bash
. You need to set your environment in ~/.zprofile
, not ~/.bash_profile
.
这篇关于无法在Catalina上设置JAVA_HOME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!