Bashprofile for MAC users. GitHub Gist: instantly share code, notes, and snippets. Open your “.bashprofile” in nano with the command below: nano /.bashprofile With “.bashprofile” open, we will want to add a new line that starts with. When you login (type username and password) via console, either sitting at the machine, or remotely via ssh:.bashprofile is executed to configure your shell before the initial command prompt. But, if you’ve already logged into your machine and open a new terminal window (xterm) then.bashrc is executed before the window command prompt.
A typical install of OS X won't create a .bash_profile for you. When you want to run functions from your command line, this is a must-have.
- Start up Terminal
- Type 'cd ~/' to go to your home folder
- Type 'touch .bash_profile' to create your new file.
- Edit .bash_profile with your favorite editor (or you can just type 'open -e .bash_profile' to open it in TextEdit).
- Type 'source .bash_profile' to reload .bash_profile and update any functions you add.
To learn more about Redfin Solutions and to get updates on new blog posts, like and follow us on Facebook, Twitter, Instagram, and LinkedIn.
Published on April 9, 2016by Daniel Lanza
By default, your system does not have the .bash_profile file for your user. Therefore you will need to create it to set environment variables for your current user when starting new session.
In this tutorial, we are going to create a .bash_profile to set $JAVA_HOME environment variable.
![Bash_profile command for mac Bash_profile command for mac](/uploads/1/2/6/2/126258906/467926125.jpg)
- First, we are going to check out that .bash_profile does not exist.
- Go to user home and create the .bash_profile file.
- Push i key to insert contents with VIM editor, and write the environment variable.
- Push esc key and type :wq to save and close the file. Then, reload the .bash_profile file.
- The .bash_profile has been executed, and $JAVA_HOME has been set.
Read next
Previous Post:How to use Sass with Jekyll (Bootstrap and Font Awesome example)
Next Post:Install Ubuntu Server 14.04.4 on VirtualBox
See also
If you are planing to develop Java Apps on your Mac, you may have to set $JAVA_HOME environment variable.Install the latest Java Virtual Machine Go to How to install JDK on Mac OS X) to install a new Java Virtual Machine. Download the latest Java JDK package from Oracle.Check Java Virtual Machines List directories in the following root -> /Library/Java/JavaVirtualMachines$ ls -l /Library/Java/JavaVirtualMachines drwxr-xr-x 3 root wheel 102 23 dic 20:36 jdk1.
Bash 3.2# Mac
Read moreIf you are planing to develop Java Apps on your Mac, you have to install the JDK package. You only have to install the binary files provided by Oracle.Download JDK 8 from Oracle WebSite [jdk-8u65-macosx-x64.dmg for Mac] Double click on jdk-8u65-macosx-x64.dmg and follow the screen instructions JDK package will have been installed in /Library/Java/JavaVirtualMachines. In my computer, I have both 1.6 and 1.8 JDK package $ ls -l /Library/Java/JavaVirtualMachines drwxr-xr-x 3 root wheel 102 14 jul 23:52 1.
Read moreBash Profile For Macbook
Requirements: Java (at least 1.6).First, check your java version by opening the terminal:$ java -version java version '1.8.0_65' Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode) Follow these steps:Download the binary Core Distribution from the original website (apache-tomcat-7.0.65.tar.gz): Apache Tomcat 7 Unzip the file downloaded Create a Tomcat folder in /Library. There we can leave several Tomcat versions to test sudo mkdir -p /Library/Tomcat sudo mv ~/Downloads/apache-tomcat-7.