From 96160ae101cb95976359dfb79d86e1e55c1aa527 Mon Sep 17 00:00:00 2001 From: Miguel Flores Ruiz de Eguino Date: Tue, 18 Mar 2014 16:00:03 -0600 Subject: [PATCH] Java 7 --- Casks/java7.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ Casks/java7u45.rb | 12 ------------ 2 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 Casks/java7.rb delete mode 100644 Casks/java7u45.rb diff --git a/Casks/java7.rb b/Casks/java7.rb new file mode 100644 index 000000000..94630e96c --- /dev/null +++ b/Casks/java7.rb @@ -0,0 +1,43 @@ +class Java < Cask + url 'http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-macosx-x64.dmg', + :cookies => { + 'oraclelicense' => 'accept-securebackup-cookie' + } + homepage 'http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html' + version '1.7.0_51' + sha256 '1312b0553bd37a232114637f05b036a6fd5d444e653adef7230ba141328f7734' + install 'JDK 7 Update 51.pkg' + after_install do + system '/usr/bin/sudo', '-E', '--', + '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string BundledApp', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist" + system '/usr/bin/sudo', '-E', '--', + '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string JNI', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist" + system '/usr/bin/sudo', '-E', '--', + '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string WebStart', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist" + system '/usr/bin/sudo', '-E', '--', + '/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string Applets', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist" + system '/usr/bin/sudo', '-E', '--', + '/bin/rm', '-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' + system '/usr/bin/sudo', '-E', '--', + '/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' + end + uninstall :pkgutil => 'com.oracle.jdk7u51', + :files => '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' + caveats <<-EOS.undent + This Cask makes minor modifications to the JRE to prevent any packaged + application issues. + + If your Java application still asks for JRE installation, you might need to + reboot or logout/login. + + The JRE packaging bug is discussed here: + + https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361 + + Installing this Cask means you have AGREED to the Oracle Binary Code License + Agreement for Java SE at + + http://www.oracle.com/technetwork/java/javase/terms/license/index.html + + EOS +end diff --git a/Casks/java7u45.rb b/Casks/java7u45.rb deleted file mode 100644 index 50d492f56..000000000 --- a/Casks/java7u45.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Java7u45 < Cask - url 'http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-macosx-x64.dmg', - :cookies => { 's_nr' => '1388004420389', - 's_cc' => 'true', - 'gpw_e24' => 'http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk7-downloads-1880260.html', - 's_sq' => '%5B%5BB%5D%5D' } - homepage 'http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html' - version '1.7.0_45' - sha1 'aa1bbf29decda9a6877f0279510cd50eabba68c1' - install 'JDK 7 Update 45.pkg' - uninstall :pkgutil => 'com.oracle.jdk7u45' -end