Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


java (142) Versions 2.0.1

Recipes and resources for installing Java and managing certificates

cookbook 'java', '= 2.0.1', :supermarket
cookbook 'java', '= 2.0.1'
knife supermarket install java
knife supermarket download java
Quality 100%

java cookbook

Build Status Cookbook Version

This cookbook installs a Java JDK/JRE. It defaults to installing OpenJDK, but it can also install Oracle and IBM JDKs.

Production Deployment with Oracle Java

Oracle has been known to change the behavior of its download site frequently. It is recommended you store the archives on an artifact server or s3 bucket. You can then override the attributes in a cookbook, role, or environment:

default['java']['jdk_version'] = '8'
default['java']['install_flavor'] = 'oracle'
default['java']['jdk']['7']['x86_64']['url'] = ''
default['java']['jdk']['7']['x86_64']['checksum'] = 'The SHA-256 checksum of the JDK archive'
default['java']['oracle']['accept_oracle_download_terms'] = true

NOTE: Oracle JDK 6 & 7 are unable to be automatically downloaded at this time.


Include the java recipe wherever you would like Java installed, such as a run list (recipe[java]) or a cookbook (include_recipe 'java'). By default, OpenJDK 6 is installed. The install_flavor attribute is used to determine which JDK to install (OpenJDK, Oracle, IBM, or Windows), and jdk_version specifies which version to install (currently 6 and 7 are supported for all JDK types, 8 for Oracle only).


To install Oracle Java 7 (note that when installing Oracle JDK, accept_oracle_download_terms attribute must be set -- see below role for an example):

name "java"
description "Install Oracle Java"
  "java" => {
    "install_flavor" => "oracle",
    "jdk_version" => "7",
    "oracle" => {
      "accept_oracle_download_terms" => true

Example role to install IBM flavored Java:

name "java"
description "Install IBM Java on Ubuntu"
  "java" => {
    "install_flavor" => "ibm",
    "ibm" => {
      "accept_ibm_download_terms" => true,
      "url" => "",
      "checksum" => "The SHA256 checksum of the bin"


Chef 12.9+


  • Debian, Ubuntu
  • CentOS, RedHat, Fedora, Scientific, Amazon, XenServer
  • ArchLinux
  • FreeBSD
  • SmartOS
  • Windows
  • Mac OS X


  • homebrew
  • windows


See attributes/default.rb for default values.

  • node['java']['install_flavor'] - Flavor of JVM you would like installed (oracle, oracle_rpm, openjdk, ibm, windows), default openjdk on Linux/Unix platforms, windows on Windows platforms.
  • node['java']['jdk_version'] - JDK version to install, defaults to '6'.
  • node['java']['java_home'] - Default location of the "$JAVA_HOME". To configure this attribute for ibm, ibm_tar, and oracle_rpm install flavors, you must use an attribute precedence of force_default or higher in your attribute file.
  • node['java']['set_etc_environment'] - Optionally sets JAVA_HOME in /etc/environment for Default false.
  • node['java']['openjdk_packages'] - Array of OpenJDK package names to install in the java::openjdk recipe. This is set based on the platform.
  • node['java']['tarball'] - Name of the tarball to retrieve from your internal repository, default jdk1.6.0_29_i386.tar.gz
  • node['java']['tarball_checksum'] - Checksum for the tarball, if you use a different tarball, you also need to create a new sha256 checksum
  • node['java']['jdk'] - Version and architecture specific attributes for setting the URL on Oracle's site for the JDK, and the checksum of the .tar.gz.
  • node['java']['oracle']['accept_oracle_download_terms'] - Indicates that you accept Oracle's EULA
  • node['java']['windows']['url'] - The internal location of your java install for windows
  • node['java']['windows']['package_name'] - The package name used by windows_package to check in the registry to determine if the install has already been run
  • node['java']['windows']['checksum'] - The checksum for the package to download on Windows machines (default is nil, which does not perform checksum validation)
  • node['java']['windows']['remove_obsolete'] - Indicates whether to remove previous versions of the JRE (default is false)
  • node['java']['windows']['aws_access_key_id'] - AWS Acess Key ID to use with AWS API calls
  • node['java']['windows']['aws_secret_access_key'] - AWS Secret Access Key to use with AWS API calls
  • node['java']['windows']['aws_session_token'] - AWS Session Token to use with AWS API calls
  • node['java']['ibm']['url'] - The URL which to download the IBM JDK/SDK. See the ibm recipe section below.
  • node['java']['ibm']['accept_ibm_download_terms'] - Indicates that you accept IBM's EULA (for java::ibm)
  • node['java']['oracle_rpm']['type'] - Type of java RPM (jre or jdk), default jdk
  • node['java']['oracle_rpm']['package_version'] - optional, can be set to pin a version different from the up-to-date one available in the YUM repo, it might be needed to also override the node['java']['java_home'] attribute to a value consistent with the defined version
  • node['java']['oracle_rpm']['package_name'] - optional, can be set to define a package name different from the RPM published by Oracle.
  • node['java']['accept_license_agreement'] - Indicates that you accept the EULA for openjdk package installation.
  • node['java']['set_default'] - Indicates whether or not you want the JDK installed to be default on the system. Defaults to true.
  • node['java']['oracle']['jce']['enabled'] - Indicates if the JCE Unlimited Strength Jurisdiction Policy Files should be installed for oracle JDKs
  • node['java']['oracle']['jce']['home'] - Where the JCE policy files should be installed to
  • node['java']['oracle']['jce'][java_version]['checksum'] - Checksum of the JCE policy zip. Can be sha256 or md5
  • node['java']['oracle']['jce'][java_version]['url'] - URL which to download the JCE policy zip



Include the default recipe in a run list or recipe to get java. By default the openjdk flavor of Java is installed, but this can be changed by using the install_flavor attribute. By default on Windows platform systems, the install_flavor is windows and on Mac OS X platform systems, the install_flavor is homebrew.

OpenJDK is the default because of licensing changes made upstream by Oracle. See notes on the oracle recipe below.

NOTE: In most cases, including just the default recipe will be sufficient. It's possible to include the install_type recipes directly, as long as the necessary attributes (such as java_home) are set.


Sets default attributes based on the JDK version. This is included by default.rb. This logic must be in a recipe instead of attributes/default.rb. See #95 for details.

Updates /usr/lib/jvm/default-java to point to JAVA_HOME.


This recipe installs the openjdk flavor of Java. It also uses the alternatives system on RHEL/Debian families to set the default Java.

On platforms such as SmartOS that require the acceptance of a license agreement during package installation, set node['java']['accept_license_agreement'] to true in order to indicate that you accept the license.


This recipe installs the oracle flavor of Java. This recipe does not use distribution packages as Oracle changed the licensing terms with JDK 1.6u27 and prohibited the practice for both RHEL and Debian family platforms.

As of 26 March 2012 you can no longer directly download the JDK from Oracle's website without using a special cookie. This cookbook uses that cookie to download the oracle recipe on your behalf, however the java::oracle recipe forces you to set either override the node['java']['oracle']['accept_oracle_download_terms'] to true or set up a private repository accessible by HTTP.

override the accept_oracle_download_terms in, e.g., roles/base.rb

      :java => {
         :oracle => {
           "accept_oracle_download_terms" => true

For both RHEL and Debian families, this recipe pulls the binary distribution from the Oracle website, and installs it in the default JAVA_HOME for each distribution. For Debian, this is /usr/lib/jvm/default-java. For RHEL, this is /usr/lib/jvm/java.

After putting the binaries in place, the java::oracle recipe updates /usr/bin/java to point to the installed JDK using the update-alternatives script. This is all handled in the java_oracle_install resource.


This recipe installs the 32-bit Java virtual machine without setting it as the default. This can be useful if you have applications on the same machine that require different versions of the JVM.

This recipe operates in a similar manner to java::oracle.


This recipe installs the Oracle JRE or JDK provided by a custom YUM repositories. It also uses the alternatives system on RHEL families to set the default Java.

While public YUM repos for Oracle Java 7 and prior are available, you need to download the RPMs manually for Java 8 and make your own internal repository. This must be done to use this recipe to install Oracle Java 8 via RPM. You will also likely need to set node['java']['oracle_rpm']['package_name'] to jdk1.8.0_40, replacing 40 with the most current version in your local repo.


Because as of 26 March 2012 you can no longer directly download the JDK msi from Oracle's website without using a special cookie. This recipe requires you to set node['java']['oracle']['accept_oracle_download_terms'] to true or host it internally on your own http repo or s3 bucket.


If you use the windows recipe, you'll need to make sure you've uploaded the aws and windows cookbooks. As of version 1.18.0, this cookbook references them with suggests instead of depends, as they are only used by the windows recipe.


The java::ibm recipe is used to install the IBM version of Java. Note that IBM requires you to create an account and log in to download the binary installer for your platform. You must accept the license agreement with IBM to use their version of Java. In this cookbook, you indicate this by setting node['java']['ibm']['accept_ibm_download_terms'] to true. You must also host the binary on your own HTTP server to have an automated installation. The node['java']['ibm']['url'] attribute must be set to a valid https/http URL; the URL is checked for validity in the recipe.

At this time the java::ibm recipe does not support multiple SDK installations.


The java::notify recipe contains a log resource that's :write action is called when a JDK version changes. This gives cookbook authors a way to subscribe to JDK changes and take actions (say restart a java service):

service 'somejavaservice' do
  action :restart
  subscribes :restart, 'log[jdk-version-changed]', :delayed



This cookbook contains the java_oracle_install resource which handles installation of Oracle's distribution of Java..

By default, the extracted directory is extracted to app_root/extracted_dir_name and symlinked to app_root/default


  • :install: extracts the tarball and makes necessary symlinks
  • :remove: removes the tarball and run update-alternatives for all symlinked bin_cmds

Attribute Parameters

  • url: path to tarball, .tar.gz, .bin (oracle-specific), and .zip currently supported
  • checksum: SHA256 checksum, not used for security but avoid redownloading the archive on each chef-client run
  • app_home: the default for installations of this type of application, for example, /usr/lib/tomcat/default. If your application is not set to the default, it will be placed at the same level in the directory hierarchy but the directory name will be app_root/extracted_directory_name + "_alt"
  • app_home_mode: file mode for app_home, is an integer
  • bin_cmds: array of binary commands that should be symlinked to /usr/bin, examples are mvn, java, javac, etc. These cmds must be in the bin subdirectory of the extracted folder. Will be ignored if this java_oracle_install is not the default
  • owner: owner of extracted directory, set to "root" by default
  • group: group of extracted directory, set to :owner by default
  • default: whether this the default installation of this package, boolean true or false
  • reset_alternatives: whether alternatives is reset boolean true or false
  • use_alt_suffix: whether _alt suffix is used for not default javas boolean true or false
  • proxy: optional address and port of proxy server, for example,


# install jdk6 from Oracle
java_oracle_install "jdk" do
    url ''
    checksum  'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365'
    app_home '/usr/local/java/default'
    bin_cmds ["java", "javac"]
    action :install


The java_alternatives resource uses update-alternatives command to set and unset command alternatives for various Java tools such as java, javac, etc.


  • :set: set alternatives for Java tools
  • :unset: unset alternatives for Java tools

Attribute Parameters

  • java_location: Java installation location.
  • bin_cmds: array of Java tool names to set or unset alternatives on.
  • default: whether to set the Java tools as system default. Boolean, defaults to true.
  • priority: priority of the alternatives. Integer, defaults to 1061.


# set alternatives for java and javac commands
java_alternatives "set java alternatives" do
    java_location '/usr/local/java'
    bin_cmds ["java", "javac"]
    action :set


This cookbook contains the java_certificate resource which simplifies adding certificates to a java keystore. It can also populate the keystore with a certificate retrieved from a given SSL end-point. It defaults to the default keystore <java_home>/jre/lib/security/cacerts with the default password if a specific keystore is not provided.


  • :install: installs a certificate.
  • :remove: removes a certificate.

Attribute Parameters

  • cert_alias: The alias of the certificate in the keystore. This defaults to the name of the resource.

Optional parameters:

  • java_home: the java home directory. Defaults to node['java']['java_home'].

  • keystore_path: the keystore path. Defaults to node['java']['java_home']/jre/lib/security/cacerts.

  • keystore_passwd: the keystore password. Defaults to 'changeit' as specified by the Java Documentation.

Only one of the following

  • cert_data: the certificate data to install
  • cert_file: path to a certificate file to install
  • ssl_endpoint: an SSL end-point from which to download the certificate


java_certificate "Install LDAP server certificate to Java CA keystore for Jenkins" do
    cert_alias node['jenkins']['ldap']['url'][/\/\/(.*)/, 1]
    ssl_endpoint node['jenkins']['ldap']['url']
    action :install
    notifies :restart, "runit_service[jenkins]", :delayed

Recommendations for inclusion in community cookbooks

This cookbook is a dependency for many other cookbooks in the Java/Chef sphere. Here are some guidelines for including it into other cookbooks:

Allow people to not use this cookbook

Many users manage Java on their own or have systems that already have java installed. Give these users an option to skip this cookbook, for example:

include_recipe 'java' if node['maven']['install_java']

This would allow a users of the maven cookbook to choose if they want the maven cookbook to install java for them or leave that up to the consumer.

Another good example is from the Jenkins Cookbook Java recipe.

Pinning to major version of cookbook and Java

This cookbook follows semver. It is recommended to pin at the major version of this cookbook when including it in other cookbooks, eg: depends 'java', '~> 1.0'

It is acceptable to set the node['java']['jdk_version'] to a specific version if required for your software to run, eg software xyz requires Java 8 to run. Refrain from pinning to specific patches of the JDK to allow users to consume security updates.


This cookbook uses test-kitchen for integration tests and ChefSpec/RSpec for unit tests. See for testing instructions.

At this time due to licensing concerns, the IBM recipe is not set up in test kitchen. If you would like to test this locally, copy .kitchen.yml to .kitchen.local.yml and add the following suite:

- name: ibm
  run_list: ["recipe[java]"]
      install_flavor: "ibm"
        accept_ibm_download_terms: true
        url: "http://jenkins/ibm-java-x86_64-sdk-7.0-4.1.bin"
        checksum: the-sha256-checksum

Log into the IBM DeveloperWorks site to download a copy of the IBM Java SDK you wish to use/test, host it on an internal HTTP server, and calculate the SHA256 checksum to use in the suite.

License and Author

Copyright: 2014-2017, Agile Orbit, LLC

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,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

windows >= 0.0.0
homebrew >= 0.0.0

Contingent cookbooks

abiquo Applicable Versions
activemq Applicable Versions
aem Applicable Versions
aet Applicable Versions
akibanserver Applicable Versions
alfresco Applicable Versions
alfresco-utils Applicable Versions
alphard-artifactory Applicable Versions
alphard-chef-artifactory Applicable Versions
alphard-chef-deploy Applicable Versions
alphard-chef-sbt Applicable Versions
android-sdk Applicable Versions
ant Applicable Versions
apache-log-analysis Applicable Versions
apache-newrelic-plugin Applicable Versions
apache_hadoop Applicable Versions
apache_kafka Applicable Versions
apache_spark Applicable Versions
apache_spark_ng Applicable Versions
apache_tomcat Applicable Versions
apache_zookeeper Applicable Versions
apktool Applicable Versions
application_java Applicable Versions
archiva Applicable Versions
ark Applicable Versions
artifact-deployer Applicable Versions
artifactory Applicable Versions
artifactory_ii Applicable Versions
asgard Applicable Versions
askbot Applicable Versions
aws-cloud-watch-cli-tools Applicable Versions
aws_developer_tools Applicable Versions
bamboo Applicable Versions
bamboo-agent Applicable Versions
baragon Applicable Versions
bastion Applicable Versions
bazel Applicable Versions
bigdata Applicable Versions
bitbucket_server Applicable Versions
bjn_java Applicable Versions
bootstrap Applicable Versions
buildr Applicable Versions
cassandra Applicable Versions
cassandra-dse Applicable Versions
cassandra-opscenter Applicable Versions
cassandra-priam Applicable Versions
cassandra-reaper Applicable Versions
cdap Applicable Versions
cerner_kafka Applicable Versions
cerner_tomcat Applicable Versions
chamber-kibana Applicable Versions
chef Applicable Versions
chef-server Applicable Versions
chef-teamcity Applicable Versions
chef_crowd Applicable Versions
chef_ec2_cli_tools Applicable Versions
chef_jira Applicable Versions
chronos Applicable Versions
coffee-truck Applicable Versions
configure_and_deploy_ssc Applicable Versions
confluence Applicable Versions
confluent Applicable Versions
confluent-cookbook Applicable Versions
coopr Applicable Versions
corbel Applicable Versions
corus Applicable Versions
couchdb Applicable Versions
cq Applicable Versions
crowd Applicable Versions
deploy-play Applicable Versions
dima-repose Applicable Versions
drelephant Applicable Versions
drill Applicable Versions
dropwizard Applicable Versions
druid Applicable Versions
dse Applicable Versions
dse-chef Applicable Versions
dynatrace Applicable Versions
dynatrace-appmon Applicable Versions
elassandra Applicable Versions
elastic Applicable Versions
elasticsearch Applicable Versions
elasticsearch-cluster Applicable Versions
elasticsearch-ng Applicable Versions
elasticsearch_cluster Applicable Versions
elk Applicable Versions
elkstack Applicable Versions
emptyness Applicable Versions
enstratius_agent_proxy Applicable Versions
epipe Applicable Versions
esri-tomcat Applicable Versions
et_elk Applicable Versions
et_gradle Applicable Versions
et_mesos Applicable Versions
eulipion-cleanspeak Applicable Versions
exhibitor Applicable Versions
flink Applicable Versions
flume Applicable Versions
flyway-cli Applicable Versions
foreflight_build_agent Applicable Versions
formatron_monitor Applicable Versions
gads Applicable Versions
ganglia_cluster Applicable Versions
gatling Applicable Versions
gerrit Applicable Versions
glassfish Applicable Versions
gobblin Applicable Versions
gocd Applicable Versions
gocd_agent Applicable Versions
gradle Applicable Versions
graphhopper Applicable Versions
graylog2 Applicable Versions
grinder Applicable Versions
groovy Applicable Versions
hadoop Applicable Versions
hadoop_cluster Applicable Versions
hadoop_cluster_rpm Applicable Versions
hadoop_for_hbase Applicable Versions
hadoop_spark Applicable Versions
hbase Applicable Versions
hbase_cluster Applicable Versions
hipsnip-jetty Applicable Versions
hive Applicable Versions
hops Applicable Versions
ice Applicable Versions
idea Applicable Versions
ignite-openfire Applicable Versions
impala Applicable Versions
intel_hadoop_metrics Applicable Versions
jar_deployment Applicable Versions
java-management Applicable Versions
java-service Applicable Versions
java_sun Applicable Versions
javadeploy Applicable Versions
jboss Applicable Versions
jboss-atg Applicable Versions
jboss7 Applicable Versions
jenkins Applicable Versions
jenkins-server Applicable Versions
jenkins_config Applicable Versions
jenkins_jnlp_slave Applicable Versions
jenkins_utils Applicable Versions
jetty Applicable Versions
jira Applicable Versions
jmeter Applicable Versions
jmxsh-chef Applicable Versions
jpackage Applicable Versions
jruby Applicable Versions
kafka Applicable Versions
kafka-cluster Applicable Versions
kafka-manager Applicable Versions
kafka_broker Applicable Versions
karaf Applicable Versions
katello Applicable Versions
keycloak Applicable Versions
kibana5-gm Applicable Versions
kibana_lwrp Applicable Versions
kkafka Applicable Versions
knotx Applicable Versions
kzookeeper Applicable Versions
lein Applicable Versions
leiningen Applicable Versions
liquibase Applicable Versions
livy Applicable Versions
logstash Applicable Versions
logstash_simple Applicable Versions
looker Applicable Versions
mapr Applicable Versions
marathon Applicable Versions
maven Applicable Versions
mecab-java Applicable Versions
mesos Applicable Versions
midokura Applicable Versions
minecraft Applicable Versions
minecraft-server Applicable Versions
mule Applicable Versions
neo4j Applicable Versions
netkernel Applicable Versions
nexus Applicable Versions
nexus_repository_manager Applicable Versions
nodestack Applicable Versions
noosfero Applicable Versions
ohmage Applicable Versions
oozie Applicable Versions
opendj-openam Applicable Versions
openfire Applicable Versions
openhab Applicable Versions
openmq Applicable Versions
opennms Applicable Versions
openoffice Applicable Versions
opentsdb Applicable Versions
oracle-fmw Applicable Versions
oracle_java Applicable Versions
orientdb Applicable Versions
paramount Applicable Versions
pennyworth Applicable Versions
petals Applicable Versions
pig Applicable Versions
pipeline Applicable Versions
platformstack Applicable Versions
polyglot Applicable Versions
protractor Applicable Versions
puncha-kibana Applicable Versions
r_config Applicable Versions
recognizer Applicable Versions
resin Applicable Versions
riak Applicable Versions
riemann2 Applicable Versions
robot Applicable Versions
rubymine Applicable Versions
rundeck Applicable Versions
rundeck-alt Applicable Versions
rundeck-server Applicable Versions
sauceconnect Applicable Versions
sbt-extras Applicable Versions
scala Applicable Versions
sda-agent Applicable Versions
simple-cerebro Applicable Versions
singularity Applicable Versions
singularity_executor Applicable Versions
sips-office-server Applicable Versions
soa_tools Applicable Versions
solr Applicable Versions
solr-lts Applicable Versions
solr_6 Applicable Versions
solrcloud Applicable Versions
sonar Applicable Versions
sonarqube_server Applicable Versions
spark Applicable Versions
spigot Applicable Versions
spinen-artifactory Applicable Versions
spring-boot Applicable Versions
stack-java Applicable Versions
stack_commons Applicable Versions
stash Applicable Versions
storm Applicable Versions
storm-cluster Applicable Versions
subrosa Applicable Versions
sudo_elastic Applicable Versions
sudo_logstash Applicable Versions
sumologic-collector Applicable Versions
takipi Applicable Versions
taurus Applicable Versions
teamcity_server Applicable Versions
tekno-mineos Applicable Versions
tensorflow Applicable Versions
thrift Applicable Versions
titan Applicable Versions
tizen Applicable Versions
tomcat Applicable Versions
tomcat-all Applicable Versions
tomcat-openam Applicable Versions
tomcat-solr Applicable Versions
tomcat7 Applicable Versions
tomcat8 Applicable Versions
tomcat_latest Applicable Versions
tomee Applicable Versions
tungsten Applicable Versions
typesafe-stack Applicable Versions
unifi Applicable Versions
unjava Applicable Versions
vault-cli Applicable Versions
vertx Applicable Versions
was_liberty Applicable Versions
webgoat Applicable Versions
weblogic Applicable Versions
webobjects Applicable Versions
wildfly Applicable Versions
wlp Applicable Versions
xldeploy Applicable Versions
xlrelease Applicable Versions
yajsw Applicable Versions
youtrack Applicable Versions
zabbix Applicable Versions
zammad Applicable Versions
zendserver Applicable Versions
zenoss Applicable Versions
zeppelin Applicable Versions
ziggrid Applicable Versions
zipkin Applicable Versions
zncrypt Applicable Versions
zookeeper Applicable Versions
zookeeper-cluster Applicable Versions
zookeeper-grid Applicable Versions
zookeeper_cluster Applicable Versions
zookeeperd Applicable Versions

Java Cookbook CHANGELOG

This file is used to list changes made in each version of the Java cookbook.

v2.0.1 - (2018-05-02)

  • Fix java_certificate and java_oracle_install to work on FIPS enabled systems

v2.0.0 - (2018-05-02)

  • Converted alternatives, ark, and certificate LWRP/HWRPs to custom resources with improved logging and convergence notification.
  • Renamed the java_ark resource to java_oracle_install, which better represents what it does. The existing name will continue to function
  • Removed the need for the apt cookbook and instead require Chef 12.9+
  • Fixed Amazon Linux support on Chef 13+.
  • Fixed the alternatives commands on Fedora systems.
  • Added initial openSUSE leap support.
  • Updated code to use multi-package installs to speed up runs
  • Made the 'cert_alias' property in the certificate resource the name_property to allow users to avoid resource cloning and to be able to use friendly resource names
  • Moved the warning code for downloading directly from Oracle into the resource to prevent another resource showing as converged
  • Updated the metadata to resolve failures to parse chef_version on older chef-client releases.
  • Added installation of tar directly to the ark resource when uncompression .tar.gz files. This prevents installation in the recipe that occurred even if tar wasn't needed.
  • Deprecated the java::purge recipe which purged old Sun Java packages which were distributed in distro repos before the Oracle acquisition of Sun. Migration away from these packages occurred many years ago and this recipe will be removed in the next major release of this cookbook.
  • Updated the metadata license string to an SPDX compliant string to resolve Foodcritic warnings.
  • Removed Chef 10 compatibility code in the Windows recipe that resulted in Foodcritic warnings.
  • Removed logic to support paths on Debian < 7 and Ubuntu < 12.04 as these are both EOL.
  • Removed duplicate logging in the resources.
  • Converted integration tests from bats to InSpec.
  • Moved template files out of the default directory as
  • Corrected deprecation warnings in the ChefSpecs.
  • Moved all Kitchen testing logic to the test_java cookbook and eliminated the need for the apt & free_bsd bash cookbooks in testing
  • Don't try to create Chef's cache directory in the certificate resource.
  • Disabled certificate integration tests since we're not currently running the certificate resource in Test Kitchen.
  • Removed testing of Oracle JDK 6/7 since Oracle no longer allows directly downloading these releases.
  • Added kitchen-dokken based testing

v1.50.0 - 05/24/2017

  • Oracle downloads changed again. Only Oracle 8 is able to be downloaded automatically. Please host your own copy internally to avoid issues such as this.
  • Add Log warning if download url contains

v1.49.0 - 04/21/2017

  • potential 'curl' resource cloning #415
  • Oracle 8u131
  • Add ChefSpec matchers for java_certificate resource
  • Remove unnecessary apt update

v1.48.0 - 03/31/2017

  • Update Oracle Java links from 101 to 121
  • Remove convergence report
  • Remove Fedora 24 testing
  • Fix test cookbook license
  • Update platforms in the specs
  • Remove testing on EOL platforms

v1.47.0 - 01/30/2017

  • Fix typo in method name (#397)
  • Remove useless ruby_block[set-env-java-home]
  • Update README: using java::notify
  • Add forgotten "do" to README

v1.46.0 - 01/09/2017

  • fix jce installation on windows #386

v1.45.0 - 12/27/2016

  • Update to resolve latest rubocop rules

v1.44.0 - 12/27/2016

  • Unpublished due to newer rubocop rules in travis
  • Added zlinux defaults

v1.43.0 - 12/6/2016

  • Switch recursive chown from executing on the jdk parent directory to executing on the jdk directory itself.
  • Added proxy support to curl
  • add java_certificate LWRP from java-libraries cookbook - java-libraries now depricated.
  • (Windows) support removal of obsolete JREs via optional attribute
  • (Windows) Can download from s3 only using an IAM profile
  • (Windows) aws session token for windows java download

v1.42.0 - 8/8/2016

  • Use openjdk ppa for all ubuntu versions to allow for older/newer jdks to be installed. Fixes #368
  • update oracle java 8u101 - Use sha256 hash (seems to help with downloading each converge)
  • Mac default converge fails since notify is not included by homebrew
  • Remove chef 14(!) depreciation warning in tests
  • Resolve chef-12 related warning

v1.41.0 - 7/15/2016

  • Feature: Add new resource for cookbooks to subscribe to, see README
  • Use a remote_file resource for JCE download instead of curl in an execute block.
  • Since v1.40.4 Travis deploys cookbook to supermarket - expect more frequent, smaller releases.

v1.40.4 - 7/12/2016

  • Automated deploy, no cookbook changes.

v1.40.3 - 7/12/2016

  • Attempt to have travis publish this.
  • Mac depends on homebrew.
  • Fixed typo in platform family spelling for OS X
  • fix openjdk version logic for freebsd
  • Enable Ark provider to handle URI with get parameters

v1.40.1 - 7/8/2016

  • Fixed: JAVA_HOME not set on systems with restrictive umask #359

v1.40 - 6/29/2016

  • Travis build green
  • Add Windows JCE support
  • Changes to prevent re-execution of resource creating file '/etc/profile.d/'
  • Fix JDK checksum
  • Update for IBM JDK 1.8
  • Install OpenJDK from distribution if Ubuntu version >= 15.10
  • Fixes #342 - Tar is included in macosx and homebrews package is gnutar which causes this to fail
  • Add 12.04 to jdk8 test suite
  • Add source and issues urls to supermarket
  • Distinguishing the Java version for installing on the Mac OS X
  • Doc and cruft cleanup

v1.39 - 1/14/2016

  • Travis debugging only, no code changes.

v1.38 - 1/13/2016

  • (Win) Fix for Java install failing on Windows (introduced in #315)
  • Travis fixes/badge

v1.37 - 11/9/2015

  • (Win) Attirbute for specifying the install directory for the public jre #315

v1.36 - 9/3/2015

  • Oracle JDK 1.8.0_65
  • Add Ubuntu ppa (allows OpenJDK 8)
  • Added ChefSpec matchers #284
  • Fix compile error using Chef::Application.fatal #279
  • 222 Provide possibility to set ark download timeout

  • Openjdk6 does not exist in deb 8.2

  • Change to create java home dir even if top level doesn't exist(Eg mkdir_p instead of mkdir)

  • Fix berks url and remove apt

  • Documentation and dependency updates

v1.35 - 8/4/2015

  • Use bento boxes and remove EOL distros from testing suite.
  • Update to latest JDKs. Note Oracle JDK7 is now EOL.
  • Alternatives improvements
  • Fixes #155 to allow install of OpenJDK 1.8
  • Fixes #257 Changed switches for the jdk 8 exe installer on windows
  • Make sure tar package installed for java_ark
  • Add support for Mac OS X "mac_os_x" via homebrew.
  • Update metadata.rb to contain source and issue information for supermarket and chef-repo convenience

Known Issues

  • Kitchen CI test with 12.04 fails due to hostname unable to be set.

v1.31 - 2/3/2015

  • Update to latest JDKs for 7 and 8. JDK7 will be EOL April 2015
  • Fix up Travis support.
  • Add ability to install JCE policy files for oracle JDK #228
  • Change connect timeout to 30 seconds

v1.29.0 - 11/14/2014


  • #216 - Ensure dirs, links, and jinfo files are owned correctly
  • #217 - Update to Oracle JDK 8u25
  • #214 - Update to Oracle JDK 7u71-b14


  • Adding a connect_timeout option for downloading java.


  • Switched to chef-zero provisioner in test suites.
  • Adding for guidance on creating new issues for the Java cookbook.
  • Fix IBM unit tests.

v1.28.0 - 9/6/2014


  • Allow setting of group to extracted java files.


  • Add -no-same-owner parameter to tar extract to avoid issues when the chef cache dir is on an NFS mounted drive.
  • In the ark provider, it doesn't compare the MD5 sum with the right value which causes Java cookbook always download tarball from oracle server

v1.27.0 - 8/22/2014

  • Update Oracle JDK8 to version 8u20

v1.26.0 - 8/16/2014

  • #201 - Allow pinning of package versions for openjdk
  • #198 - Update Oracle JDK7 to version 7u67
  • #189 - Support specific version and name for Oracle RPM

v1.25.0 - 8/1/2014


  • #189 - Resource ark -> attribute bin_cmds default value
  • #168 - Add option to put JAVA_HOME in /etc/environment
  • #172 - Allow ark to pull from http and files ending in .gz.


  • Recommendations for inclusion in community cookbooks
  • Production Deployment with Oracle Java
  • Update testing instructions for chefdk
  • Various Readme formatting.


  • Use Supermarket endpoint in berksfile
  • rspec cleanup
  • Adding ubuntu-14.04 to test suite

v1.24.0 - 7/25/2014

New Cookbook maintainer! Agile Orbit


  • #192 - Bump JDK7 URLs to 7u65
  • #191 - Upgrade Oracle's Java 8 to u11
  • #188 - Allow for alternatives priority to be set from attribute.
  • #176 - Change ownership of extracted files
  • #169 - Add retries and retry_delay parameters to java_ark LWRP
  • #167 - default: don't fail when using java 8 on windows
  • #165 - Support for Server JRE
  • #158 - Updated README for accepting oracle terms
  • #157 -Remove VirtualBox specific box_urls
  • List AgileOrbit as the maintainer (AgileOrbit took over from Socrata in July 2014)

v1.23.0 - 7/25/2014

  • Tagged but never published to community cookbooks. All changes rolled into 1.24.0



  • #148 - Add support for Oracle JDK 1.8.0
  • #150 - Make use of Chef's cache directory instead of /tmp
  • #151 - Update Test Kitchen suites
  • #154 - Add safety check for JDK 8 on non-Oracle



  • #146 - Update Oracle accept-license-terms cookie format





  • #137 - Create /usr/lib/jvm/default-java on Debian
  • #138 - allow wrapping cookbook without providing templates
  • #140 - Adds set_default attribute to toggle setting JDK as default


  • #141 - set java_home correctly for oracle_rpm



  • #129 - Upgrade to ChefSpec 3
  • Rewrite unit tests for better coverage and to work with ChefSpec 3 (various commits)
  • List Socrata as the maintainer (Socrata took over from Opscode in December 2013)



Refactor the cookbook to better support wrapper cookbooks and other cookbook authoring patterns.





  • #118 - Upgrade to 7u51
  • #117 - Suggest windows and aws



  • Revert COOK-4165 - The headers option was only added to remote_file in Chef 11.6.0, meaning this change breaks older clients.



  • #111 - Fix alternatives for centos


  • COOK-4165 - Replace curl with remote_file with cookie header
  • #110 - Update openjdk to use the alternatives resource



  • COOK-4136 - Add md5 parameter to java_ark resource




  • #103 - set alternatives when using ibm_tar recipe
  • #104 - Specify windows attributes in attribute files



  • COOK-3488 - set alternatives for ibm jdk
  • COOK-3764 - IBM Java installer needs 'rpm' package on Ubuntu


  • COOK-3857 - do not unescape the java windows url before parsing it
  • #95 - fixes update-alternatives for openjdk installs
  • #100 - Use escaped quotes for Windows INSTALLDIR




[COOK-4210] - remove unneeded run_command to prevent zombie processes


[CHEF-4210] remove unneeded run_command to prevent zombie processes



  • Fixing version number. Accidently released at 0.15.x instead of 1.15.x



  • [COOK-3908] - Fixing JAVA_HOME on Ubuntu 10.04



  • COOK-3704 - Fix alternatives when the package is already installed
  • COOK-3668 - Fix a condition that would result in an error executing action run on resource 'bash[update-java-alternatives]'
  • COOK-3569 - Fix bad checksum length
  • COOK-3541 - Fix an issue where Java cookbook installs both JDK 6 and JDK 7 when JDK 7 is specified
  • COOK-3518 - Allow Windoes recipe to download from signed S3 url
  • COOK-2996 - Fix a failure on Centos 6.4 and Oracle JDK 7




  • COOK-3295 - Add default platform_family option in Java helper
  • COOK-3277 - Fix support for Fedora




  • [COOK-2154]: Add SmartOS support to java::openjdk recipe
  • [COOK-3278]: upgrade to Oracle Java 7u25


  • [COOK-2931]: Adding support for the platform 'xenserver' (for installations of java in DOM0)
  • [COOK-3277]: java cookbook fails on Fedora



  • [COOK-2847]: Java cookbook does not have opensuse support
  • [COOK-3142]: Syntax Errors spec/default_spec.rb:4-8



  • [COOK-2989]: bash[update-java-alternatives] resource uses wrong attribute



  • Use SHA256 checksums for Oracle downloads, not SHA1.


This version brings a wealth of tests and (backwards-compatible) refactoring, plus some new features (updated Java, IBM recipe).


  • [COOK-2897]: Add ibm recipe to java cookbook
  • [COOK-2903]: move java_home resources to their own recipe
  • [COOK-2904]: refactor ruby_block "update-java-alternatives"
  • [COOK-2905]: use platform_family in java cookbook
  • [COOK-2920]: add chefspec to java cookbook


  • [COOK-2902]: Refactor java cookbook


  • [COOK-2900]: update JDK to JDK 7u21, 6u45


  • [COOK-2415] - Fixed deprecation warnings in ark provider and openjdk recipe by using Chef::Mixin::ShellOut instead of Chef::ShellOut


  • [COOK-2400] - Allow java ark :url to be https
  • [COOK-2436] - Upgrade needed for oracle jdk in java cookbook


  • [COOK-2412] - add support for Oracle Linux


  • [COOK-2083] - Run set-env-java-home in Java cookbook only if necessary
  • [COOK-2332] - ark provider does not allow for *.tgz tarballs to be used
  • [COOK-2345] - Java cookbook fails on CentOS6 (update-java-alternatives)


  • [COOK-2306] - FoodCritic fixes for java cookbook


  • [COOK-2236] - Update the Oracle Java version in the Java cookbook to release 1.7u11


  • [COOK-2205] - Fix for missing /usr/lib/jvm/default-java on Debian


  • [COOK-2095] - Add windows support


  • [COOK-2001] - improvements for Oracle update-alternatives

    • When installing an Oracle JDK it is now registered with a higher priority than OpenJDK. (Related to COOK-1131.)
    • When running both the oracle and oracle_i386 recipes, alternatives are now created for both JDKs.
    • Alternatives are now created for all binaries listed in version specific attributes. (Related to COOK-1563 and COOK-1635.)
    • When installing Oracke JDKs on Ubuntu, create .jinfo files for use with update-java-alternatives. Commands to set/install alternatives now only run if needed.


  • [COOK-1930] - fixed typo in attribute for java 5 on i586


  • whyrun support in java_ark LWRP
  • CHEF-1804 compatibility
  • [COOK-1786]- install Java 6u37 and Java 7u9
  • [COOK-1819] -incorrect warning text about node['java']['oracle']['accept_oracle_download_terms']


  • [COOK-1218] - Install Oracle JDK from Oracle download directly
  • [COOK-1631] - set JAVA_HOME in openjdk recipe
  • [COOK-1655] - Install correct architecture on Amazon Linux


  • [COOK-885] - update alternatives called on wrong file
  • [COOK-1607] - use shellout instead of execute resource to update alternatives


  • [COOK-1200] - remove sun-java6-jre on Ubuntu before installing Oracle's Java
  • [COOK-1260] - fails on Ubuntu 12.04 64bit with openjdk7
  • [COOK-1265] - Oracle Java should symlink the jar command


  • [COOK-1146] - Oracle now prevents download of JDK via non-browser
  • [COOK-1114] - fix File.exists?


  • [COOK-1051] - fix attributes typo and platform case switch consistency


  • [COOK-858] - numerous updates: handle jdk6 and 7, switch from sun to oracle, make openjdk default, add java_ark LWRP.
  • [COOK-942] - FreeBSD support
  • [COOK-520] - ArchLinux support

Collaborator Number Metric

2.0.1 passed this metric

Contributing File Metric

2.0.1 passed this metric

Foodcritic Metric

2.0.1 passed this metric

No Binaries Metric

2.0.1 passed this metric

Testing File Metric

2.0.1 passed this metric

Version Tag Metric

2.0.1 passed this metric