Python One-liner for Determining Java Vendor



Here’s a Python one-liner that prints the Java vendor on OS X clients, (e.g., Apple or Oracle).

python -c 'import os,plistlib; jv = plistlib.readPlist(os.path.join(os.path.realpath("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin"), "Contents/Info.plist"))["CFBundleIdentifier"].split(".")[1]; print jv.capitalize()'

Why?

…Because we can.

comments powered by Disqus