You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

71 lines
3.4 KiB

cask 'java-beta' do
version '1.8.0_152-b03'
sha256 'ed7c452d39a8bd1e2e7d316e72b5fda6d8558410b18b6ecfa1a5e347e058ad7a'
url 'http://download.java.net/java/jdk8u152/archive/b03/binaries/jdk-8u152-ea-bin-b03-macosx-x86_64-19_apr_2017.dmg',
cookies: { 'oraclelicense' => 'accept-securebackup-cookie' }
name 'Java Standard Edition Development Kit'
homepage 'http://jdk.java.net/8/'
pkg "JDK #{version.minor} Update #{version.split('_')[1].split('-')[0]}.pkg"
postflight do
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string BundledApp', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string JNI', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string WebStart', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string Applets', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"],
sudo: true
system_command '/bin/mkdir',
args: ['-p', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/bundle/Libraries"],
sudo: true
system_command '/bin/ln',
args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/jre/lib/server/libjvm.dylib", "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/bundle/Libraries/libserver.dylib"],
sudo: true
if MacOS.version <= :mavericks
system_command '/bin/rm',
args: ['-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'],
sudo: true
system_command '/bin/ln',
args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'],
sudo: true
end
end
uninstall pkgutil: 'com.oracle.jdk8u122',
delete: [
MacOS.version <= :mavericks ? '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' : '',
].keep_if { |v| !v.empty? }
zap delete: [
'~/Library/Application Support/Oracle/Java',
'~/Library/Caches/com.oracle.java.Java-Updater',
'~/Library/Caches/net.java.openjdk.cmd',
],
rmdir: '~/Library/Application Support/Oracle/'
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