Skip to main content
Question

Best way to keep the Java's updated?

  • January 16, 2014
  • 7 replies
  • 3 views

ImAMacGuy
Forum|alt.badge.img+23

We install both the Apple Java and the JDK 7 u XX installed on the systems. I have an EA that reports the java version, but it only reports one of them (typically JDK 7s). So I scope the policy that if the JDK isn't teh current version, then I push both the apple and the JDK...

is there a better way to do this?

7 replies

Forum|alt.badge.img+10
  • Contributor
  • 161 replies
  • January 16, 2014

Not that this is a 'better' way but this is how we manage the Javas (Javi?)

We update Java (oracle) 1.7.x with JSS policies scoped to a smartgroup. That smartgroup is based on Plug-In title and version.

We update Java (OS) 1.6 with NetSUS appliance. In the past we used JSS policies with the smartgroup based on an Extension Attribute

Here is the code for the EA that picks up the Java (OS) version:

#!/bin/bash

#Check if java_home is defined
javaHome=`/usr/libexec/java_home 2> /dev/null`;

if [ ! -z $javaHome ]
then
vers=`java -version 2>&1 | grep "java version" | awk '{print substr($3,2,length($3)-2);}'`
echo "<result>$vers</result>"
else
echo "<result>Not Installed</result>"
fi

Forum|alt.badge.img+8
  • Valued Contributor
  • 122 replies
  • January 23, 2014

Hi there, not exactly what you asked for but…
I also did split the updates in Java (OS) and Java (Oracle) in the past but I installed JDK 7u51 on a fresh installed machine (10.8.5) yesterday and this seems to be different:
The EA for Oracle and the EA for OS both show now 7u51. The stuff I did a quick test with is running,... Could it be "one install to rule them all" ?


ImAMacGuy
Forum|alt.badge.img+23
  • Author
  • Esteemed Contributor
  • 1310 replies
  • January 23, 2014

that's what I am thinking, I'm just looking for confirmation I think :)


Forum|alt.badge.img+8
  • Valued Contributor
  • 122 replies
  • January 23, 2014

… I overlooked a programm that needs 32-bit Java, so I cannot get rid of Java 6 :-( back to "twin" installation :-(
Here the EA for Java PlugIns

#!/bin/sh

#  jav7.sh
#  
#!/bin/bash

# Christoph von Gabler-Sahm (email-redacted)
# Version 1.0

# checks installed version of Java Applet Plugin
# returns values like "Not installed", "JavaInstallOnDemand: 14.5.0", "JavaJDK16: 14.5.0" or "Java 7 Update 09"

PLUGINPATH="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin"

# Plugin version
S_VERSION=$( /usr/bin/defaults read "${PLUGINPATH}/Contents/Info" CFBundleShortVersionString 2>/dev/null )

# JavaInstallOnDemand or empty
S_PROJECT=$( /usr/bin/defaults read "${PLUGINPATH}/Contents/version" ProjectName 2>/dev/null )

if [[ -e "${PLUGINPATH}" ]]; then
    if [[ "${S_PROJECT}" == "" ]]; then
        EA_RESULT="${S_VERSION}"
    else
        EA_RESULT="${S_PROJECT}: ${S_VERSION}"
    fi
else
    EA_RESULT="Not installed"
fi

echo "<result>${EA_RESULT}</result>"

Forum|alt.badge.img+5
  • New Contributor
  • 4 replies
  • January 23, 2014

@jwojda Have you run into any issues with pushing a JDK? Just curios if it has created issues if someone is using the JDK when it upgrades.


Forum|alt.badge.img+8
  • Valued Contributor
  • 122 replies
  • January 24, 2014

I had a prg that was not working when I pushes the upgrade on top of the old one. Since then I do a uninstall of the old package before I deploy the new one.


Forum|alt.badge.img+12
  • Employee
  • 128 replies
  • January 24, 2014