How To Disable Java on OS X Lion to Protect from Zero-Day Bug

A Java zero-day exploit was reported today. Here’s how to disable Java on OS X Lion so that for the time being, you won’t accidentally run any applets that could compromise the security of your system(s). A command to reverse your changes is also included so that once the all clear is given we can very easily enable Java again. That said, not many public websites use Java these days, so it is worth considering the idea of leaving it disabled indefinitely.

/usr/libexec/PlistBuddy -c "Set GeneralByTask:Any:WebComponentsEnabled 0" /Users/$USER/Library/Preferences/ByHost/com.apple.java.JavaPreferences.$(ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }').plist

You can confirm it worked properly by running Java Preferences (you can search for it via Spotlight) and checking to ensure the “Enable Applet plug-in and Web Start applications” box is NOT checked.

When you’re ready to re-enable Java, you can run this command:

/usr/libexec/PlistBuddy -c "Set GeneralByTask:Any:WebComponentsEnabled 1" /Users/$USER/Library/Preferences/ByHost/com.apple.java.JavaPreferences.$(ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }').plist

Michael is the creator and main author of the Smalley Creative Blog. He is a guy who enjoys technology (particularly open source), educating people about technology, and working with people who enjoy technology as much as he does. Follow him on Twitter @michaeljsmalley.

One comment: On How To Disable Java on OS X Lion to Protect from Zero-Day Bug

Leave a reply:

Your email address will not be published.

Site Footer