Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 11+28: Remove now–non-applicable DSL code. #52605

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 7 additions & 59 deletions Casks/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
pkg "JDK #{version.before_comma}.pkg"

postflight do
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string BundledApp', "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk/Contents/Info.plist"],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string JNI', "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk/Contents/Info.plist"],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string WebStart', "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk/Contents/Info.plist"],
sudo: true
system_command '/usr/libexec/PlistBuddy',
args: ['-c', 'Add :JavaVM:JVMCapabilities: string Applets', "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk/Contents/Info.plist"],
sudo: true
system_command '/bin/ln',
args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk/Contents/Home", '/Library/Java/Home'],
sudo: true
Expand All @@ -41,55 +29,15 @@
sudo: true
end

uninstall pkgutil: [
"com.oracle.jdk-#{version.before_comma}",
'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.before_comma}.jdk/Contents",
'/Library/PreferencePanes/JavaControlPanel.prefPane',
'/Library/Java/Home',
'/Library/Java/MacOS',
],
rmdir: "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk"

zap trash: [
'/Library/Application Support/Oracle/Java',
'/Library/Preferences/com.oracle.java.Deployment.plist',
'/Library/Preferences/com.oracle.java.Helper-Tool.plist',
'~/Library/Application Support/Java/',
'~/Library/Application Support/Oracle/Java',
'~/Library/Caches/com.oracle.java.Java-Updater',
'~/Library/Caches/Oracle.MacJREInstaller',
'~/Library/Caches/net.java.openjdk.cmd',
'~/Library/Preferences/com.oracle.java.Java-Updater.plist',
'~/Library/Preferences/com.oracle.java.JavaAppletPlugin.plist',
'~/Library/Preferences/com.oracle.javadeployment.plist',
],
rmdir: [
'/Library/Application Support/Oracle/',
'~/Library/Application Support/Oracle/',
]
uninstall pkgutil: "com.oracle.jdk-#{version.before_comma}",
delete: [
"/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk/Contents",
'/Library/Java/Home',
'/Library/Java/MacOS',
],
rmdir: "/Library/Java/JavaVirtualMachines/jdk-#{version.before_comma}.jdk"

caveats do
license 'https://www.oracle.com/technetwork/java/javase/terms/license/javase-license.html'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caveat is still applicable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

     🤦‍♂️ Right; not sure why I overlooked that this should be kept when first preparing this PR. I'll fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already fixed the caveat and style errors.

<<~EOS
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.
EOS
end
end