1. Download the JDK (jdk-8u121-linux-i586.tar.gz).
2. Extract the downloaded tar file and extracted the folder named as “jdk1.8.0-121”.
3. Create directory java (it could be any other name also like jvm etc,) inside the path /usr/lib from terminal.
sudo mkdir java
4. Move the extracted jdk folder under /usr/lib/java
sudo mv dk1.8.0-121/ /usr/lib/java
5. Now run the commands to let the OS know about the java utilies installed (set auto mode)
sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/java/jdk1.8.0-121/bin/java” 1
sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/java/jdk1.8.0-121/bin/javac” 1
sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/lib/java/jdk1.8.0-121/bin/javaws” 1
6. Then, check the java version for proper installantion
7. Set the environment variables in .bashrc file.
Now, write the following lines in the opened .bashrc file.
8. Open another terminal and check the environment variables.
9. Now down load the Hadoop library and components from hadoop.apache.org (hadoop-1.2.0.tar.gz or higher stable release). Extract the tar file. The hadoop library and components are extracted in the folder (hadoop-1.2.0).
10. Create directory named as “hadoop” in the location /usr/lib/
sudo mkdir hadoop
11. Move the hadoop extracted folder from Downloads directory to /usr/lib/hadoop
sudo mv hadoop-1.2.0/ /usr/lib/hadoop
12. Open the .bashrc file setting environment variable HADOOP_HOME and PATH.