Best way to keep the Java's updated?

ImAMacGuy
Valued Contributor II

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 7

frozenarse
Contributor II

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

michaelhusar
Contributor II

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
Valued Contributor II

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

michaelhusar
Contributor II

… 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>"

WesWhet
Release Candidate Programs Tester

@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.

michaelhusar
Contributor II

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.

krichterjr
Contributor

Just an FYI....looks like Apple may be done with Java 6.
http://derflounder.wordpress.com/2014/01/23/end-of-the-road-for-apples-java-6-updates/