/build/static/layout/Breadcrumb_cap_w.png

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.


0 Comments   [ + ] Show comments

Answers (2)

Posted by: JasonEgg 3 years ago
Red Belt
2

We use this custom inventory rule to get the Java version:

PlistValueReturn(/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Info.plist, CFBundleVersion, TEXT)

Posted by: TheITNooB 3 years ago
Orange Belt
1

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

WB3fvAmbL+jthcoADZkbVVpQgUgSJQBIpAEdgFAi1AdnEMVaIIFIEiUASKwHUh8P8Dka4uwoME4+4AAAAASUVORK5CYII=

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ