Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't set JAVA_HOME on Catalina

I use Catalina. I created the .bash_profile file and edited it.

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.

What is the problem?

like image 680
Baris Avatar asked Aug 09 '26 05:08

Baris


1 Answers

New user accounts in Catalina default to using zsh, not bash. You need to set your environment in ~/.zprofile, not ~/.bash_profile.

like image 89
chepner Avatar answered Aug 10 '26 18:08

chepner