无法在Catalina上设置JAVA_HOME [英] Can't set JAVA_HOME on Catalina

查看:637
本文介绍了无法在Catalina上设置JAVA_HOME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用卡塔琳娜州.我创建了.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆