Skip to main content

How to Setup Jenkins on Mac – Part 1

I want to mention how to setup a Jenkins server on our Mac OSX machine.I will to explain setup process step by step so I will separate each step by numbers.

Before I start to setup Jenkins I need to install some dependencies which are Java 1.7 JDK,Maven 3.2.2),Apache Tomcat 8.

I’m starting to explain with first dependency which is Java JDK:

1)Setting Up Java JDK

Firstly I’m downloading java from its official web page by following this path:jdk-7u65-macosx-x64.dmg.After I downloaded necessary folders I need to set JAVA_HOME path for java jdk folder so I will use terminal in order to do that.In terminal,I can use vim text editor so I’m writing vim .bash_profile to go to the vim and then I need to write this command here:

export JAVA_HOME=$(/usr/libexec/java_home)

After I set JAVA_HOME I need to save and quit from vim editor so I need to click ESC button and then writing :wq! then clicking ENTER button.

Finally I can complete my installing process by checking whether it’s installed successfully or not so I need to use java -version command in terminal.

Output of this command should be like this:

java version “1.7.0_*”
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

*(it can be 51-58-60)

I also need to see where java is installed by using echo $JAVA_HOME in terminal

It should returns a output like this:


2)Setting Up Maven

I can continuous with maven setup after I completed to install Java JDK on my machine. I need to download maven from this path:apache-maven-3.2.2-bin.tar.gz after I unzip and download I need set its M2 path in my machine so I need to use again vim text editor.I’m opening it by entering vim .bash_profile in terminal.After I opened vim editor I need to click I(letter) in order to insert new entry in vim text editor.

I need to add these export commands in my terminal:
export M2_HOME=/Users/zafer/Documents/dev/apache-maven-3.2.2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

All exports should be like this:

export JAVA_HOME=$(/usr/libexec/java_home)
export M2_HOME=/Users/zafer/Documents/dev/apache-maven-3.2.2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export PATH=$JAVA_HOME/bin:$PATH

As I said before you need to shut down vim editor by clicking ESC button and then :wq!

I need to check installing process whether its completed successfully or not so I’m writing

mvn –version

I should to see this output in my terminal:

Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T16:51:42+03:00)
Maven home: /Users/zafer/Documents/dev/apache-maven-3.2.2
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “mac os x”, version: “10.9.4”, arch: “x86_64”, family: “mac”

I also should to see where maven is installed by using this command in terminal:

echo $M2

It should returns an output like this:


3)Setting Up Apache-Tomcat 8

We need manage our Jenkins by using any Application server so I prefer to use Apache Tomcat.Actually This process is simple easy just use this path:tar.gz unzip and install on your local machine.

By the way,I can recommend to use Tomcat Controller in order to open and shut down our Tomcat Application Server easily.

We can download it from here: