Skip to main content
Solved

Oracle Java version extension attribute


Forum|alt.badge.img+19

Hello jamfnation- does anyone have an extension attribute that can report the Oracle java version in addition to Apple's versions?
All the extension attributes I've seen are based on the java -version bash command, which only seems to return information about the apple-supplied JRE, not the one from Oracle.

Best answer by stevewood

If you pick through this post:

https://jamfnation.jamfsoftware.com/discussion.html?id=5641#respond

You'll find this link to Rich Trouton's blog:

http://derflounder.wordpress.com/2012/10/31/casper-extension-attribute-scripts-to-report-java-browser-plug-in-info/

I'm using Rich's method to identify the vendor, and the method he links to to identify the version.

View original
Did this topic help you find an answer to your question?

3 replies

stevewood
Forum|alt.badge.img+35
  • Employee
  • 1797 replies
  • Answer
  • February 7, 2013

If you pick through this post:

https://jamfnation.jamfsoftware.com/discussion.html?id=5641#respond

You'll find this link to Rich Trouton's blog:

http://derflounder.wordpress.com/2012/10/31/casper-extension-attribute-scripts-to-report-java-browser-plug-in-info/

I'm using Rich's method to identify the vendor, and the method he links to to identify the version.


Forum|alt.badge.img+19
  • Author
  • Contributor
  • 437 replies
  • February 7, 2013

Perfect, thanks Steve!!


Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • February 8, 2013

Hi Guys,

A bit late to the party here, but I came up with a solution for several customers to report every version of Java installed on their Macs, and then pump that into an EA.

#!/bin/bash

# set get numeric values of versions from the java framework folder
# grab integers only

javaVersions=$(/bin/ls /System/Library/Frameworks/JavaVM.framework/Versions | /usr/bin/grep '[0-9].[0-9]')

# now loop through the results and into an extension attribute

for i in ${javaVersions}; do

  echo "<result>${i}</result>"
  done

# now check for version 7

version7=$(/bin/ls /Library/Java/JavaVirtualMachines/)

if [[ ${version7} != "" ]]

  then /bin/echo "<result>${version7}</result>"

fi

exit 0

This was quick and dirty and on the fly but it seems to be what the customer wanted. So, hopefully this may help some of you. If you look at the java binary it is just a symbolic link to the current version in the framework folder, however when you install the newest Java it puts it in a different location and I think (have not verified this yet) it uses a totally different command line binary.

Hope this helps,
Tom


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings