Build Hadoop 2.7.x from source code on ubuntu

Following are the steps for building Hadoop 2.7.x from source code on ubuntu.

Checout Hadoop Code from Git

git clone git://
git checkout branch-2.7.3


Install Dependencies

Install dependencies from apt-get

sudo apt-get update
sudo apt-get install openjdk-7-jdk maven git openssl dh-autoreconf cmake zlib1g-dev libssl-dev ssh rsync pkg-config

Install protocol buffer

tar xvf v2.5.0.tar.gz
cd protobuf-2.5.0
./configure --prefix=/usr
make install

Install findbugs

unzip download


Set Environment Variables

vim ~/.bashrc

## Put following lines at end of ~/.bashrc file
## Please change the path with appropriate value for your installation

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
export FINDBUGS_HOME=/opt/findbugs-3.0.0/


Build Hadoop Distribution

mvn clean install -Pdist,native,docs,src -Dtar -DskipTests

Hadoop tar.gz distribution will be created in hadoop-dist/target/ directory