Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your ".profile" or ".bash_profile" are simply files that are present in your "home" folder. If you open a Finder window and click your account name in the Favorites pane ... you won't see them. If you open a Terminal window and type "ls" to list files ... you still won't see them. But you can find them by using "ls -a" in the terminal. Or if you open your favorite text editor (say TextEdit since it comes with OS X) and do File->Open and then press Command+Shift+. and click on your account name (home folder) you will see them as well. If you do not see them, then you can simply create one in your favorite text editor.</p> <p>Now, adding environment variables is fairly straightforward and remarkably similar to windows conceptually. In your .profile just add, one per line, the variable name and its value as follows:</p> <pre><code>export JAVA_HOME=/Library/Java/Home export JRE_HOME=/Library/Java/Home </code></pre> <p>etc.</p> <p>If you are modifying your "PATH" variable, be sure to include the system's default PATH that was already set for you:</p> <pre><code>export PATH=$PATH:/path/to/my/stuff </code></pre> <p>Now here is the quirky part, you can either open a new Terminal window to have the new variables take effect, or you will need to type ". .profile" or ". .bash_profile" to reload the file and have the contents be applied to your current Terminal's environment.</p> <p>You can check that your changes took effect using the "set" command in your Terminal. Just type "set" (or "set | more" if you prefer a paginated list) and be sure what you added to the file is there.</p> <p>As for adding environment variables to GUI apps, that is normally not necessary and I'd like to hear more about what you are specifically trying to do to better give you an answer for it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload