New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin to a specific oracle jdk version #184

samangarg opened this Issue Jun 23, 2014 · 1 comment


None yet
2 participants

samangarg commented Jun 23, 2014


As a reminder, the oracle_rpm recipe is aimed to install and configure Oracle jdk or jre package provided by a custom YUM repository. Oracle does not host such repository. It is up to you to initialize this YUM repo with the rpm downloaded from Oracle web site.

In the current version of the recipe, it is not foreseen to pin a specific version of the jre/jdk. It basically calls 'yum upgrade jre' or 'yum upgrade jdk', based on node['java']['oracle_rpm']['type']. Thus, it will install or upgrade to the up-to-date package available in the custom repository. It is assumed that this repository does not mix packages from different java major versions (1.6, 1.7), so that it is not necessary to specify a version in the recipe.

If you really need to manage precisely the version, please, feel free to submit a ticket.

Hope it clarifies.


Le 20 juin 2014 11:06, "Garg, Saman" a écrit :

We downloaded the java cookbook from community and we tried to see if we could start using it without re-inventing the wheel. But we ran into some issues which we thought we should share with you and get feedback.
If those are real issues, you guys may help get improvements in future versions of the cookbook.

Requirement: To be able to pin jdk package install to a specific version of Oracle jdk.
Issue: In the below block of code from recipes/oracle_rpm.rb, it tries to set the commands based on jdk or jre using the attribute "case node['java']['oracle_rpm']['type']" and when it tries to install the package, it is using the same attribute "case node['java']['oracle_rpm']['type']" so it's not possible to pin it to a specific jdk version.

Am I missing something here OR this is something that is already in your enhancement pipeline?

======== FROM: recipes/oracle_rpm.rb ===============

slave_cmds = case node['java']['oracle_rpm']['type']
when 'jdk'
%W[appletviewer apt ControlPanel extcheck idlj jar jarsigner javac javadoc javafxpackager javah javap java-rmi.cgi javaws jcmd jconsole jcontrol jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc]
when 'jre'
%W[ControlPanel java_vm javaws jcontrol keytool orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200]
Chef::Application.fatal "Unsupported oracle RPM type (#{node['java']['oracle_rpm']['type']})"

package node['java']['oracle_rpm']['type'] do
action :upgrade
notifies :run, 'bash[update-java-alternatives]', :immediately if platform_family?('rhel', 'fedora') and node['java']['set_default']


carguel added a commit to carguel/chef-cookbook-java that referenced this issue Jul 10, 2014


This comment has been minimized.


erichelgeson commented Aug 16, 2014

Closed in #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment