mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-06-30 06:12:15 -06:00
Technically, it is open-source: see http://openjdk.java.net/ There are various proprietary closed modules included to OpenJDK that make it Oracle JDK, however. Downloading and installing this cask means that you agree to the terms of Oracle Binary Code License Agreement: http://www.oracle.com/technetwork/java/javase/terms/license/index.html
74 lines
4 KiB
Ruby
74 lines
4 KiB
Ruby
class Java < Cask
|
|
version '1.8.0_20'
|
|
sha256 '4d76dfc983ae3413fcc33979d86a454a3e9a2df501d988f74502d5c28cc08d22'
|
|
|
|
url 'http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-macosx-x64.dmg',
|
|
:cookies => {
|
|
'oraclelicense' => 'accept-securebackup-cookie'
|
|
}
|
|
homepage 'http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html'
|
|
license :gratis
|
|
|
|
pkg 'JDK 8 Update 20.pkg'
|
|
postflight 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'
|
|
system '/usr/bin/sudo', '-E', '--',
|
|
'/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home", '/Library/Java/Home'
|
|
system '/usr/bin/sudo', '-E', '--',
|
|
'/bin/mkdir', '-p', '--', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Home/bundle/Libraries"
|
|
system '/usr/bin/sudo', '-E', '--',
|
|
'/bin/ln', '-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"
|
|
end
|
|
uninstall :pkgutil => [
|
|
'com.oracle.jdk8u20', # manually update this for each version
|
|
'com.oracle.jre',
|
|
],
|
|
:launchctl => [
|
|
'com.oracle.java.Helper-Tool',
|
|
'com.oracle.java.Java-Updater',
|
|
],
|
|
:quit => [
|
|
'com.oracle.java.Java-Updater',
|
|
'net.java.openjdk.cmd', # Java Control Panel
|
|
],
|
|
:delete => [
|
|
'/Library/Internet Plug-Ins/JavaAppletPlugin.plugin',
|
|
"/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents",
|
|
'/Library/PreferencePanes/JavaControlPanel.prefPane',
|
|
'/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK',
|
|
'/Library/Java/Home',
|
|
'/usr/lib/java/libjdns_sd.jnilib',
|
|
]
|
|
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 issues with
|
|
packaged applications, as discussed here:
|
|
|
|
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
|
|
|
|
If your Java application still asks for JRE installation, you might need
|
|
to reboot or logout/login.
|
|
|
|
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
|