This is what I did to set up Hadoop on my Ubuntu machine.
- Install the Java Development Kit.
$ sudo apt-get install default-jdk - Download the latest release of Hadoop here.
- Unpack the archive.
$ tar -xvf hadoop-2.8.0.tar.gz - Move the resulting folder.
$ sudo mv hadoop-2.8.0 /usr/local/hadoop - Find the location of the Java package.
$ readlink -f /usr/bin/java | sed "s#bin/java##" /usr/lib/jvm/java-8-openjdk-amd64/jre/ - Edit the Hadoop configuration file at
/usr/local/hadoop/etc/hadoop/hadoop-env.shand setJAVA_HOME.export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/ - Test.
$ /usr/local/hadoop/bin/hadoop version
If the final command returns some information about Hadoop then the installation was successful.