Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No .bash_profile on my Mac

I'm trying to develop using Eclipse/Maven on my Mac and while setting environment variables there is no .bash_profile. I do ls -a and still not there. I see a .bash_history and .bash_sessions. Where am I supposed to set my JAVA_HOME and PATH?

Thank you!

like image 620
fumeng Avatar asked Nov 13 '17 19:11

fumeng


2 Answers

For anyone else stumbling up on this after Mac Catalina,

Starting CATALINA the default shell is zsh. The profile file name for zsh is ~/.zprofile.

To setup bash as your default:

  1. Open terminal
  2. Goto preferences and choose "Shell opens with"
  3. Click on "Command(complete path)" and type "/bin/bash" to start bash shell
like image 97
theDbGuy Avatar answered Sep 16 '22 12:09

theDbGuy


In your terminal:

touch ~/.bash_profile; open ~/.bash_profile

Then make your edits and save. This is generic so make sure your path is correct in the above example.

like image 33
Brian Wright Avatar answered Sep 20 '22 12:09

Brian Wright