Home > Casper, Java, Mac administration, Mac OS X, Scripting > Casper Extension Attribute script to detect Java build 1.6.0_51-b11-456-10M4508

Casper Extension Attribute script to detect Java build 1.6.0_51-b11-456-10M4508

To follow up on the re-release of Apple’s Java For Mac OSX 10.6 Update 16 and Java for OS X 2013-004 updates, which fixes a problem with the previous versions of the updates, there’s a need to identify which machines got the problematic version of Java. The problematic Java build is 1.6.0_51-b11-456-10M4508 and can be identified by running the following command:

/usr/libexec/java_home -v 1.6 -exec java -version

Update – June 24, 2013: On further examination, it looks like Apple used two different build numbers:

Mac OS X 10.6.x: 1.6.0_51-b11-456-10M4508
Mac OS X 10.7.x – 10.8.x: 1.6.0_51-b11-456-11M4508

To help Casper admins identify which Macs have 1.6.0_51-b11-456-10M4508 or  1.6.0_51-b11-456-11M4508 installed, I’ve posted the following Casper extension attribute to my GitHub repo:

This script uses the java -version command to check the Java build version. If Java builds 1.6.0_51-b11-456-10M4508 or 1.6.0_51-b11-456-11M4508 are detected, the script reports Installed. If neither 1.6.0_51-b11-456-10M4508 or 1.6.0_51-b11-456-11M4508 are installed on the Mac, the script reports Not Found.

For those interested, the script is available on my GitHub repo:


  1. slk00
    June 24, 2013 at 1:12 am

    Line 17
    shouldn’t it be;
    if [ “$JAVA_BUILD_CHECK” = “1.6.0_51-b11-457-11M4508” ]

  2. June 24, 2013 at 1:28 am

    Thanks for catching that. That line was actually right, it was the comments and the build number used in the blog post that were incorrect. Now fixed.

  3. ljnelson
    June 25, 2013 at 5:04 pm

    I use this to populate the EA:


    VER=`/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -version 2>&1 | grep “Java(TM) SE Runtime” | awk ‘{print $6}’ | sed ‘s/)//’`

    echo “$VER”

    This allows me to control via Smart Group which machines need the update, and I don’t need to keep making changes to the EA every time Java is updated.. Is there an added benefit to replacing the version with “Installed” or “Not Found”?

    • June 25, 2013 at 5:16 pm

      In my case, I wasn’t interested in an EA that I would keep using long-term. This was a (hopefully) one time use to detect these specific Java builds.
      Normally, I track Apple’s Java versions by what’s provided by Software Update. In this case, I needed to ID a specific Java build because Apple didn’t change the name of the Java update.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: