From 360fa935a20b5fd17194f2a0eb703461d1b778aa Mon Sep 17 00:00:00 2001 From: ContinualIntegration Date: Tue, 7 Nov 2017 23:07:25 -0500 Subject: [PATCH 1/5] Update openjdk.rb. I changed openjdk from version 6 to version 8. --- recipes/openjdk.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/openjdk.rb b/recipes/openjdk.rb index ff211bb..7ac692d 100644 --- a/recipes/openjdk.rb +++ b/recipes/openjdk.rb @@ -42,15 +42,15 @@ if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon") ruby_block "update-java-alternatives" do block do - if platform?("ubuntu", "debian") and version == 6 + if platform?("ubuntu", "debian") and version == 8 run_context = Chef::RunContext.new(node, {}) r = Chef::Resource::Execute.new("update-java-alternatives", run_context) - r.command "update-java-alternatives -s java-6-openjdk" + r.command "update-java-alternatives -s java-8-openjdk" r.returns [0,2] r.run_action(:create) else - # have to do this on ubuntu for version 7 because Ubuntu does - # not currently set jdk 7 as the default jvm on installation + # have to do this on ubuntu for version 7 because Ubuntu does # n/a now + # not currently set jdk 7 as the default jvm on installation # n/a now require "fileutils" arch = node['kernel']['machine'] =~ /x86_64/ ? "x86_64" : "i386" Chef::Log.debug("glob is #{java_home_parent}/java*#{version}*openjdk*") From c10e82075e922eaabf35f5cc38332c5b61a6273c Mon Sep 17 00:00:00 2001 From: ContinualIntegration Date: Tue, 7 Nov 2017 23:10:41 -0500 Subject: [PATCH 2/5] Update default.rb A few changes to make it work with Ubuntu 16.x as the Chef-client and work with Chef version 13. --- attributes/default.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 93d4b3d..b192712 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -19,10 +19,11 @@ # default jdk attributes default['java']['install_flavor'] = "openjdk" -default['java']['jdk_version'] = '6' -default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586" +default['java']['jdk_version'] = '8' +#default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586" +default['java']['arch'] = "x86_64" # For Ubuntu 16.04, the above line needed to be commented out. -case platform +case node['platform'] # Needs to be compatible with Chef version 13. when "centos","redhat","fedora" default['java']['java_home'] = "/usr/lib/jvm/java" when "freebsd" From b7deec17080b0d1359a45a0eaba1cc635099cbeb Mon Sep 17 00:00:00 2001 From: ContinualIntegration Date: Tue, 7 Nov 2017 23:48:09 -0500 Subject: [PATCH 3/5] Update metadata.rb Gave it a name. --- metadata.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/metadata.rb b/metadata.rb index c07261c..719c87e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,3 +1,4 @@ +name 'java' maintainer "Opscode, Inc." maintainer_email "cookbooks@opscode.com" license "Apache 2.0" From a483a01de9e4b5a0ed7f349360fce15b40c21147 Mon Sep 17 00:00:00 2001 From: ContinualIntegration Date: Thu, 9 Nov 2017 14:47:24 -0500 Subject: [PATCH 4/5] Update openjdk.rb --- recipes/openjdk.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/openjdk.rb b/recipes/openjdk.rb index 7ac692d..747a4ce 100644 --- a/recipes/openjdk.rb +++ b/recipes/openjdk.rb @@ -63,8 +63,8 @@ FileUtils.ln_sf jdk_home, java_home cmd = Chef::ShellOut.new( - %Q[ update-alternatives --install /usr/bin/java java #{java_home}/bin/java 1; - update-alternatives --set java #{java_home}/bin/java ] + %Q[ update-alternatives --install /usr/bin/java java ${java_home}/bin/java 1; + update-alternatives --set java ${java_home}/bin/java ] ).run_command unless cmd.exitstatus == 0 or cmd.exitstatus == 2 Chef::Application.fatal!("Failed to update-alternatives for openjdk!") From ced9b0a3d56204a88d6830cbc1554e4f0dcd71fb Mon Sep 17 00:00:00 2001 From: ContinualIntegration Date: Thu, 9 Nov 2017 15:02:28 -0500 Subject: [PATCH 5/5] Update openjdk.rb Commented out arch stanza on line 55. --- recipes/openjdk.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/openjdk.rb b/recipes/openjdk.rb index 747a4ce..c44002f 100644 --- a/recipes/openjdk.rb +++ b/recipes/openjdk.rb @@ -52,7 +52,7 @@ # have to do this on ubuntu for version 7 because Ubuntu does # n/a now # not currently set jdk 7 as the default jvm on installation # n/a now require "fileutils" - arch = node['kernel']['machine'] =~ /x86_64/ ? "x86_64" : "i386" + #arch = node['kernel']['machine'] =~ /x86_64/ ? "x86_64" : "i386" Chef::Log.debug("glob is #{java_home_parent}/java*#{version}*openjdk*") jdk_home = Dir.glob("#{java_home_parent}/java*#{version}*openjdk{,[-\.]#{arch}}")[0] Chef::Log.debug("jdk_home is #{jdk_home}") @@ -63,8 +63,8 @@ FileUtils.ln_sf jdk_home, java_home cmd = Chef::ShellOut.new( - %Q[ update-alternatives --install /usr/bin/java java ${java_home}/bin/java 1; - update-alternatives --set java ${java_home}/bin/java ] + %Q[ update-alternatives --install /usr/bin/java java #{java_home}/bin/java 1; + update-alternatives --set java #{java_home}/bin/java ] ).run_command unless cmd.exitstatus == 0 or cmd.exitstatus == 2 Chef::Application.fatal!("Failed to update-alternatives for openjdk!")

AltStyle によって変換されたページ (->オリジナル) /