Skip to content

Instantly share code, notes, and snippets.

@dderusha
Last active August 29, 2015 14:24
Embed
What would you like to do?
Java JDK Extension Attribute
###Test Code###
### Intention is to figure out what JDK the user has installed.
### our current Ext atty reports the JRE, we need to know they have the JDK
## thanks to elliotjordon
## -00 is just a number to say that JDK is not installed. makes for better smartgroup searches
###############
if JDKver=$(ls "/Library/Java/JavaVirtualMachines" | awk -F "_|.jdk" '/.jdk/{print $2}' | tail -1)
then
echo "<result>$JDKver</result>"
else
echo "<result>-00</result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment