Creating a cluster with a specific Java version

When you create a new Data Hub or Data Lake cluster, you can specify Java 8 or Java 11 as the default JDK.

Java 11

When you launch a new Data Hub or Data Lake cluster, the default JDK version is Java 8 unless you specify Java 11. If you specify Java 11 as the default JDK version, Cloudera Manager and all Runtime services (as well as all workloads launched) will use pre-installed Java 11 dependencies rather than Java 8. This may be useful, for instance, when you have workloads such as Spark 3 jobs that are written in Java 11, when your workloads have Java 11 dependencies, or if you are running third-party components on a cluster that require Java 11.

The ability to launch new Data Hub and Data Lake clusters with Java 11 is currently available only through the CDP CLI. Include the parameter --java-version in the create-<cloud_provider>-datalake and create-<cloud_provider>-datahub CLI commands. Valid inputs for the --java-version parameter are 8 and 11.

Launching clusters with Java 11 as the default is supported from Cloudera Runtime versions 7.2.15.11 and 7.2.16.200 and above. Creating clusters with the Java version property set to 11 on older Runtime versions will be blocked by an internal validation. Currently, the Java version selection is only available when creating a new cluster.

Java 8 and 11 compatibility

Java 11 introduces breaking changes, which could lead to incompatibility with your current workloads or custom/third-party Java-based applications deployed on Data Hub clusters.

Cloudera recommends that all existing production workloads are tested before moving them over to a Data Hub cluster that is set to use Java 11 as the default JDK.

Note that Data Lake and Data Hub hosts will continue to have both Java 8 and 11 pre-installed. The --java-version switch controls which Java versionn should be set as the OS default during bootstrapping of the hosts. Therefore, it is possible to continue to run jobs written for Java 8 even if the OS default is Java 11. Some services (for example, Spark) make this possible by setting the JAVA_PATH environment variable to point to the Java 8 path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.[...].x86_64/jre/bin/java.