Skip to content

Instantly share code, notes, and snippets.

@opragel
Created February 14, 2015 07:02
Show Gist options
  • Save opragel/b2c5819f1afa50ef1d88 to your computer and use it in GitHub Desktop.
Save opragel/b2c5819f1afa50ef1d88 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Displays Oracle JRE version or N/A if not found
printf '<result>'
if [ -e /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java ]; then
result=$(defaults read /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Info.plist CFBundleVersion)
printf "%s" "$result"
else
printf 'N/A'
fi
printf '</result>'
#ea_display_name Oracle JRE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment