So I ran into an interesting issue on my system with Java. When the 1.0.7_21 JDK was installed and I attempted to revert the Internet Plugin to leverage Apples 1.6.x CrashPlan and Self Service would crash. That issue seems a bit more in depth then I really want to mess with. So I made this Extension Attribute to check if the JDK was installed and what version. That way I can avoid deploying to these systems which would really put a damper on my day.
Enjoy it! Improve it! Use it!
#!/bin/sh
# exta_jdkCheck.sh
#
#
# Created by Andrew Seago on 05/22/13.
# set -x # DEBUG. Display commands and their arguments as they are executed
# set -v # VERBOSE. Display shell input lines as they are read.
# set -n # EVALUATE. Check syntax of the script but dont execute
## Variables
####################################################################################################
jdk6=`ls /Library/Java/JavaVirtualMachines | grep "jdk" | grep "1.6" | sed 's/.jdk//' | sed 's/jdk//'`
jdk7=`ls /Library/Java/JavaVirtualMachines | grep "jdk" | grep "1.7" | sed 's/.jdk//' | sed 's/jdk//'`
## Script
####################################################################################################
if [ "$jdk6" != "" ] || [ "$jdk7" != "" ]; then
echo "<result>$jdk6 $jdk7</result>"
else
echo "<result>NoJDK</result>"
fi
exit 0