Mac Development Environment Setup

Over the years the list bellow has become my go to reference for setting up a new Mac.  These are the bare bone tools I will recommend for some serious development on a Mac, especially around Java and the open source world.  Read through, make it yours and add to it.

Firstly, as always with a Mac you’ll need to agree to apple’s Xcode terms to make full use of the terminal.
#go to your terminal and run :
xcode-select --install

 

Install iTerm.

An extremely great alternative to the in-built mac terminal

 

.profile

Add .profile settings for syntax terminal highlighting.  Why not? After all we spent quite a lot of time on bash terminals why not make them more interesting.  It might just help prevent you from typing the wrong command in the incorrect terminal.

Example Bash_Profile:


# Bash Colors
export TERM="xterm-color"
export CLICOLOR="true"
export LSCOLORS="exfxcxdxbxegedabagacad"

# Bash Prompt customisation with current location
export PS1='\[\033[01;35m\]\u\[\033[34m\]@\[\033[36m\]\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[31m\]$(git branch -l 2>/dev/null | sed -n s/^*//p) $(hg branch 2>/dev/null) \$\[\033[00m\]'

#  Java Home Over-ride
#export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_45`
#export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_79`

 

Sublime Text

Sublime has gone pass the test of time for the new kid in the block text editor to a must have for all developers and dev-ops.  Install Sublim from here and its package manager

 

Font Made for Code

Install a equal width font like: Adobe Source Pro Font

 

Latest Python tools

Install python from here PIP command

 

Maven Installation

Download maven and unzip to preferred location

 

Set Path in profile:

  • ~/.bash_profile
export M2_HOME=/Users/developer/apache-maven-3.1.1 
export PATH=$PATH:$M2_HOME/bin

 

  • Post Configuration… set’up your maven .m2 settings.xml file
  • See more Installation Instructions here

 

Package manager

There are many options there but I will strongly recommend Brew :
Installs the stuff that apple did not, With Brew from here

 

# Example installation commands, as simple as:
brew install python
brew install git
brew install ruby
brew install node
brew install mongo

Automate Enabling/Disabling Hidden Files on a Mac

# show/hide hidden files
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'

 

Mac Host File Edit

Go here to edit your host file, blocking out distracting sites such as facebook, twitter, hacker news e.t.c.  Simply re-route them back to localhost:
/private/etc/hosts
# Example entry to route facebook to an invalid ip
0.0.0.0 facebook.com

# Example entry to route facebook to your internal ticketing system
jira.intranet facebook.com

Leave a Reply