Where is the .bashrc or .bash_profile

I'm working to get Java 6 SoyLatte for OSX 10.4 installed on my 10.4.11 install of OSX. I'm running into trouble with the PATH environmental variables. Im not a newbie but I don't understand how OSX is storing the PATH. I've read a few pages on how OSX manages PATH.


But I don't have a .bashrc, or .bash_profile, or any 'RC'-like named file in either my home directory or in root. These instructions suggest that I can make this file if it doesn't already exist. But here's the kicker. The web page JavaFX And JDK6 On 32Bit MacOS instructions say to run these lines in the terminal/shell:


Mac:$ export JAVA_HOME=/sw/soylatte16-i386-1.0.2

Mac:$ export PATH=/sw/soylatte16-i386-1.0.2/bin:$PATH


And I did. However, now when I type:


$ echo $PATH


the above typed paths show up under PATH, but the /sw/ directory does not exist. I didn't recognize this notation it to think to change it. So, now I have this PATH that doesn't go anywhere. So where is the bash file that terminal--Im using terminal to run these commands--is referencing to get this PATH with the incorrect /sw/ directory? And, according to one of the pages I read about OSX and terminal, it is supposed to reference the .bash_profile and not .bashrc. But I can't find either file.


X

TiG4/667, Mac OS X (10.4.11)

Posted on Jun 30, 2011 7:59 PM

Reply
2 replies

Jul 1, 2011 12:39 AM in response to Christian Simon

There are multiple elements to your question...


first off, the .bashrc and .bash_profile files may well not exist, but you can just create the in your home directory and they'll automatically be employed when you open a new shell (assuming you're using a shell that references these files, but that's a separate issue).


as for the statement:


the above typed paths show up under PATH, but the /sw/ directory does not exist


well, that's completely different - adding the directory to your $PATH doesn't automatically create the directory. Sure, technically, it's an error to include a non-existent directory in your $PATH, but there's nothing to stop you doing it. There may be an even bigger problem, though - if you're following the instructions then you've missed a step, somewhere - either you've installed the files in a different location, or you haven't yet installed the files it needs. Without knowing more about the app or what you've done, it's impossible to know which is the case.

If you've installed the app in some location other than /sw/ then you'll need to adjust the $PATH values to reflect where you did install it.

Jul 1, 2011 6:26 AM in response to Christian Simon

As Camelot has said, shell initialization files do not exist by default. You will want to create a .bash_profile


nano $HOME/.bash_profile


Feel free to use whatever text editor you prefer, including a nice GUI text editor such as TextWrangler, or one of the workhorse Unix text editors such as vi, Vim, or emacs.


You would put the export commands into the .bash_profile


export JAVA_HOME="/sw/soylatte16-i386-1.0.2"

export PATH="/sw/soylatte16-i386-1.0.2/bin:$PATH"


Now restart your Terminal session, and you should have an updated PATH, as well as a JAVA_HOME environment variable.


With respect to /sw, that is where the Fink Open Source package manager stores things <http://www.finkproject.org/>. If you have not installed Fink, and if you did not use Fink to install your Java package, then the instructions you are following do not apply to your Java installation.


If you installed Java directly, the it might be installed under /usr/local directory tree.


Just for completeness (and it has nothing to do with what you are doing), the other common Mac OS X Open Source package manager is MacPorts.org which uses /opt/local as the location for packages it installs.


As a recap, on Mac OS X, there are 3 common Open Source package locations. /usr/local, /sw, and /opt/local. Exactly where you Java package has been installed may or may not be in one of these common locations.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Where is the .bashrc or .bash_profile

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.