Configuring a Custom Java Home Location

Although not recommended, the Java Development Kit (JDK), which Cloudera services require, may be installed at a custom location if necessary. These steps assume you have already installed the JDK during product installation or as part of an upgrade.

Configuring java home location for Cloudera Manager

To modify the Cloudera Manager configuration to ensure the JDK can be found:
  1. Log into the Cloudera Manager server host.
  2. Open the following file in a text editor:
    /etc/default/cloudera-scm-server
  3. Add the following line:
    export JAVA_HOME=path to the Java installation directory 
    For example:
    export JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0
  4. Save the file.
  5. Restart the Cloudera Manager Server.
    sudo systemctl restart cloudera-scm-server

Configuring java home location for CDP services

Perform the following steps for setting up the JAVA_HOME for CDP services (such as Oozie server, HDFS NameNode, YARN Resource Manager etc.) controlled by Cloudera Manager:
  1. Open the Cloudera Manager Admin Console.
  2. In the main navigation bar, click the Hosts tab. If you are configuring the JDK location on a specific host only, click the link for that host.
  3. Click the Configuration tab.
  4. Select Category > Advanced.
  5. Set the Java Home Directory property to the custom location.
  6. Click Save Changes.
  7. Restart all services.

A Hadoop client command such as hdfs dfs -ls <path> does not communicate with Cloudera Manager and relies on Bigtop to determine the JAVA_HOME. When you set up the JAVA_HOME through /etc/default/bigtop-utils (setting export JAVA_HOME=<custom java home location>), then this removes the dependency on Bigtop’s rule-based decisioning to determine the JAVA_HOME and might be helpful if you are using a custom JAVA_HOME location.