Detect Java Version on MacOS
Dear all,
Does anybody know a way to detect Java installation and version on MacOS using KACE?
I would like to detect if Java is installed and remove it from the device where it's installed.
Thanks in advance.
Answers (2)
https://www.java.com/en/download/help/version_manual.html
The last section will show you how to get the version via terminal and can utilize in a Custom Inventory Rule. JasonEgg shared a great way on finding the Java JRE version (Also found in System Preferences - Java Control panel) via the Info.plist file, I might have to use that as well!
If you want to see the Java JDK version installed you can setup a Custom Inventory Rule with the following command:
ShellCommandTextReturn(java -version 2>&1 >/dev/null | grep 'java version' | awk '{print $3}' | tr -d \")Using those 2 Custom Inventory Rules you can see in my screenshot this mac has
Java JDK version 16
Java JRE 8.221