Forge Home


The Java module installs Oracle JDK or JRE on your node.


9,401 latest version

1.3 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

  • 1.0.2 (latest)
  • 1.0.1
  • 1.0.0
released Mar 6th 2015
This version is compatible with:
  • , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'oscerd-java', '1.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install oscerd-java --version 1.0.2

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.

Tags: java, jdk, jre, oracle


oscerd/java — version 1.0.2 Mar 6th 2015

Puppet Java Module


This module install JDK or JRE with puppet


Clone this repository in a java directory in your puppet module directory

    git clone java


If you include the java::setup class the module will take the package from /java/files folder, extract his content and move it in a specific directory (based on the OS we are working on). Here is an example:

    java::setup { "java":
      type => "jdk",
      family => "7",
      update_version => "65",
      architecture => "x64",
      os => "linux",
      extension => ".tar.gz",
      tmpdir => "",
      alternatives => "",
      export => ""

It's important to define a global search path for the exec resource to make module work. This should usually be placed in manifests/site.pp. It is also important to make sure unzip and tar command are installed on the target system:

    Exec {
      path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",

    package { 'tar':
      ensure => installed

    package { 'unzip':
      ensure => installed


The Puppet Java module use the following parameters in his setup

  • Type: Possible values of family are jdk or jre
  • Family: Possible values of Java version 6, 7, 8
  • Update Version: The update version
  • Architecture: The architecture related to the package. Possible values of architecture are i586, x64, sparc, sparcv9 (the last two need to be tested)
  • Operating System: The operating system related to the package, at this moment we support linux only
  • Extension: The file extension, at this moment is .tar.gz
  • Install Directory: The directory where the Apache Tomcat will be installed (default is /opt/)
  • Temp Directory: The directory where the java package will be extracted (default is /tmp/)
  • Alternatives: Possible values are yes, no and undef (default is no). If alternatives have value yes, then the module will make update alternatives to set the correct path to java, javac and javaws (in case of type jdk) or only java (in case of jre)
  • Export: Possible values are yes, no and undef (default is no). If export is set on yes, then module will export new JAVA_HOME environment variable.


The Puppet java module has been tested on the following Operating Systems:

  1. CentOS 6.5 x64
  2. Debian 7.5 x64
  3. Fedora 20.0 x86_64
  4. Ubuntu 14.04 x64


Feel free to contribute by testing, opening issues and adding/changing code

Puppet Forge

The Puppet Java Module has been published on Puppet Forge:


Copyright 2014 Oscerd and contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.