Java 7 can’t work with chef installation

I have a packaged recipe with a recipe, recipe / default RB, which reads the following:

include_recipe "apt"

node.override[:java][:jdk_version] = '7'

include_recipe "java"

I have apt and Java recipes from community websites I only use this packaging recipe to run the tool guide

When I converge to a node, it installs Java 6 instead of Java 7 I think I have some obvious deficiencies, but I can't figure it out node. Override should not do this, so the default JDK_ Will version 6 be overwritten?

Solution

Prove my answer with "I'm not a chef expert"... But I think the problem is the "nested attribute" in chef I don't think you can continue to just overwrite the version, because after stripping away all possible things that may go wrong in your piddly formula, I found this:

http://lists.opscode.com/sympa/arc/chef/2012-10/msg00265.html

After setting the default JDK version, some other properties will be set If you look here:

http://community.opscode.com/cookbooks/java/source

You will see that the default ['java '] ['openjdk_packages'] is set with this default version, and the openjdk recipe (possibly the selected "install_flavor") only views this attribute It is not directly in the JDK_ Read in version Interestingly, the Java:: Oracle recipe (as well as Java:: oracle_i386 and Java:: oracle_rpm) is read directly in the version, so your initial attempt will apply to this

I will try to set up one of these versions according to your specific platform:

Redhat/CentOS: node.override[:java][:openjdk_packages] = ["java-1.7.0-openjdk","java-1.7.0-openjdk-devel"]
Debian/Ubuntu: node.override[:java][:openjdk_packages] = ["openjdk-7-jdk"]

Other "platform_family" options can be found here: https://github.com/opscode-cookbooks/java/blob/master/attributes/default.rb

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>