java

Installs the correct Java package on various platforms.

23,510,960 downloads

8,738 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 11.1.0 (latest)
  • 11.0.1
  • 11.0.0
  • 10.1.2
  • 10.1.1
  • 10.1.0
  • 10.0.0
  • 9.0.1
  • 9.0.0
  • 8.2.0
  • 8.1.0
  • 8.0.0
  • 7.3.0
  • 7.2.0
  • 7.1.1
  • 7.1.0
  • 7.0.2
  • 7.0.1
  • 7.0.0
  • 6.5.0
  • 6.4.0
  • 6.3.0
  • 6.2.0
  • 6.1.0
  • 6.0.0
  • 5.0.1
  • 5.0.0
  • 4.1.0
  • 4.0.0
  • 3.3.0
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.4.0
  • 2.3.0
  • 2.2.0
  • 2.1.1
  • 2.1.0
  • 2.0.0
  • 1.6.0
  • 1.5.0
  • 1.4.3
  • 1.4.2
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.1
  • 1.0.0
  • 0.3.0
  • 0.2.0
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
released May 20th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.10 < 7.0.0
  • , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-java', '4.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-java
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-java --version 4.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/java — version 4.0.0 May 20th 2019

Reference

Table of Contents

Classes

Public Classes

  • java: This module manages the Java runtime package

Private Classes

  • java::config:
  • java::params: This class builds a hash of JDK/JRE packages and (for Debian) alternatives. For wheezy/precise, we provide Oracle JDK/JRE options, even though those are not in the package repositories.

Defined types

  • java::oracle: Installs Oracle Java. By using this module you agree to the Oracle licensing agreement.

Classes

java

This module manages the Java runtime package

Parameters

The following parameters are available in the java class.

distribution

Data type: String

The java distribution to install. Can be one of "jdk" or "jre", or other platform-specific options where there are multiple implementations available (eg: OpenJDK vs Oracle JDK).

Default value: 'jdk'

version

Data type: Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/]

The version of java to install. By default, this module simply ensures that java is present, and does not require a specific version.

Default value: 'present'

package

Data type: Optional[String]

The name of the java package. This is configurable in case a non-standard java package is desired.

Default value: undef

package_options

Data type: Optional[Array]

Array of strings to pass installation options to the 'package' Puppet resource. Options available depend on the 'package' provider for the target OS.

Default value: undef

java_alternative

Data type: Optional[String]

The name of the java alternative to use on Debian systems. "update-java-alternatives -l" will show which choices are available. If you specify a particular package, you will almost always also want to specify which java_alternative to choose. If you set this, you also need to set the path below.

Default value: undef

java_alternative_path

Data type: Optional[String]

The path to the "java" command on Debian systems. Since the alternatives system makes it difficult to verify which alternative is actually enabled, this is required to ensure the correct JVM is enabled.

Default value: undef

java_home

Data type: Optional[String]

The path to where the JRE is installed. This will be set as an environment variable.

Default value: undef

Defined types

java::oracle

Defined Type java::oracle

Install one or more versions of Oracle Java.

Uses the following to download the package and automatically accept the licensing terms:

wget --no-cookies --no-check-certificate --header \
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"

Parameters

The following parameters are available in the java::oracle defined type.

ensure

Data type: Any

Install or remove the package.

Default value: 'present'

version

Data type: Any

Version of Java to install, e.g. '7' or '8'. Default values for major and minor versions will be used.

Default value: '8'

version_major

Data type: Any

Major version which should be installed, e.g. '8u101'. Must be used together with version_minor.

Default value: undef

version_minor

Data type: Any

Minor version which should be installed, e.g. 'b12'. Must be used together with version_major.

Default value: undef

java_se

Data type: Any

Type of Java Standard Edition to install, jdk or jre.

Default value: 'jdk'

oracle_url

Data type: Any

Official Oracle URL to download binaries from.

Default value: 'http://download.oracle.com/otn-pub/java/jdk/'

proxy_server

Data type: Any

Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)

Default value: undef

proxy_type

Data type: Any

Proxy server type (none|http|https|ftp). (passed to archive)

Default value: undef

url

Data type: Any

Full URL, including oracle_url, release_major, release_minor and package_name, to download the Oracle java_se installer. Originally present but not used, activated to workaround MODULES-5058.

Default value: undef

url_hash

Data type: Any

Directory hash used by the download.oracle.com site. This value is a 32 character string which is part of the file URL returned by the JDK download site.

Default value: undef

jce

Data type: Any

Install Oracles Java Cryptographic Extensions into the JRE or JDK

Default value: false

basedir

Data type: Any

Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat.

Default value: undef

manage_basedir

Data type: Any

Whether to manage the basedir directory. Defaults to false. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.

Default value: false

package_type

Data type: Any

Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. Optional forced package types: rpm, rpmbin, tar.gz

Default value: undef

manage_symlink

Data type: Any

Whether to manage a symlink that points to the installation directory. Defaults to false.

Default value: false

symlink_name

Data type: Any

The name for the optional symlink in the installation directory.

Default value: undef