Chapter 5. Installing the JDK

HDP requires that the Java SE Development Kit (JDK) v1.6 update 31 or later must be installed on all the nodes in your cluster. Follow the instructions listed below to deploy the JDK manually:

  1. Obtain the version of JDK currently installed on your host machine.

    java -version
     
  2. Uninstall the Java package if JDK version is less than v 1.6 update 31.

    rpm -qa | grep java 
    yum remove java-1.x.0-jdk-1.x.0.0-1.45.1.11.1.el6.x86_64

    Step 3: Verify that the default Java package is uninstalled.

    which java
     
  3. Download Oracle JDK jdk-6u31-linux-x64.binon all the host machines.

  4. Change directory to the location where you downloaded the JDK and run the install.

    mkdir /usr/jdk1.6.0_31
    cd /usr/jdk1.6.0_31
    chmod u+x $JDK_download_directory/jdk-6u31-linux-x64.bin
    $JDK_download_directory/jdk-6u31-linux-x64.bin -noregister
    
  5. Create symbolic links (symlinks) to the JDK.

    mkdir /usr/java
    ln -s /usr/jdk1.6.0_31/jdk1.6.0_31 /usr/java/default
    ln -s /usr/java/default/bin/java /usr/bin/java
    
  6. Set up your environment to define JAVA_HOME to put the Java Virtual Machine and the Java compiler on your path.

    export JAVA_HOME=/usr/java/default
    export PATH=$JAVA_HOME/bin:$PATH