Ubuntu – Install Java 7 with Chef using Opscode Java Community Cookbook

chefjavaUbuntu

I am trying to install Java 7 on Ubuntu with the opscode java community cookbook.

Java 6 seems to be the option no matter what incantation I make:

[2013-09-24T00:24:32+00:00] INFO: Processing package[openjdk-6-jdk] action install (java::openjdk line 49)

These are the relevant details of my wrapper:

#berks
cookbook "java", :git => "git@github.com:opscode-cookbooks/java.git"

#recipe
node.set["java"]["install_flavor"] = "openjdk"
node.set["java"]["jdk_version"] = "7"

include_recipe "java::default"

Any help would be appreciated.

Best Answer

I couldn't find a way of doing this without putting an override in the role. I added this:

override_attributes \
  :java => {
        :jdk_version => "7"
  }

I think the issue is that once the overrides are executed in the recipe it is too late.

Related Topic