Skip to main content
Question

Java 7 Preferences


Forum|alt.badge.img+8

I'm looking at trying to manage some of the settings for the new Oracle Java environment; like turning off the pref that looks for updates. Anybody already doing this and have any good information? Haven't had a chance to see if this doc applies yet or not:

http://docs.oracle.com/javase/7/docs/technotes/guides/deployment/deployment-guide/properties.html

57 replies

Forum|alt.badge.img+10
  • Employee
  • 36 replies
  • February 7, 2013

I'm also looking for a way to manage the auto update feature.
i'd also like to disable it either vai MCX or script and policy...


Forum|alt.badge.img+8

OK, I've got a script that seems to be working. It creates the necessary file (deployment.properties) to manage all user preferences, and turns off the "Check for Updates" preference for all users in Java 7, update 13. Let me know if you find any problems with it... it's worked so far in my testing. If you want to still allow the user to turn auto update on, remove the .locked line.

(Edited 3-2-13. Now includes suppressing the update prompt when opening a Java app, as well as removal of the Launch Agent)

#!/bin/bash


####################################################################################################
# Creates pref file for Java 7 that has setting which turns off the auto update check feature
# Created by AS (3-2-13)
####################################################################################################
####################################################################################################



/bin/echo "Beginning running disable_java_updates script"


####################################################################################################
# Get number variable needed to set suppression of update reminder
####################################################################################################

NUMBER=`/bin/cat /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled.plist |grep ';deploy=' |cut -d"=" -f2 |cut -d"<" -f1`

    echo The number for suppression of this version of Java is "$NUMBER"


    # Verify that it received a numeric value

        case "$NUMBER" in 
        [0-9]*) 
                echo "Entry is a numeric value.  Continuing..."
                ;;
        * ) 
                echo "Error: This entry is not a number.  Will fail to properly suppress update pop up."
                ;;
        esac



####################################################################################################
# Remove Updater Launch Agent Sym Link that gets created during updates
####################################################################################################

    /bin/echo "Checking to see if Launch Agent sym link exists..."

        if [ -f /Library/LaunchAgents/com.oracle.java.Java-Updater.plist ]; then

            /bin/echo "Launch Agent exists.  Removing."

            /bin/rm /Library/LaunchAgents/com.oracle.java.Java-Updater.plist

            /bin/echo "Removed Update Launch Agent Sym Link"

        else
                    /bin/echo "Launch Agent does not exist."

        fi


####################################################################################################
# Remove Updater Launch Daemon Sym Link that gets created during updates
####################################################################################################

    /bin/echo "Checking to see if Launch Daemon sym link exists..."

        if [ -f /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist ]; then

            /bin/echo "Launch Daemon exists.  Removing."

            /bin/rm /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist

            /bin/echo "Removed Update Launch Daemon Sym Link"

        else
                    /bin/echo "Launch Daemon does not exist."

        fi


####################################################################################################
####################################################################################################


        # Check to see if Java Plugin exists
        if [ -d /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home ]; then


                echo "Java Plugin is installed, continuing..."


                        if [ ! -f /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties ]; then

                                /bin/echo "The deployment.properties file does not yet exist.  Will create..."


                                    # Create deployment.properties file
                                        /usr/bin/touch /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Created deployment.properties file"


                                    # Change ownership on this new file
                                        /usr/sbin/chown root:wheel /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed ownership on deployment.properties file"


                                    # Change permissions on this file
                                        /bin/chmod 755 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed permissions on deployment.properties file"


                                    # Write contents of this file
                                        /bin/echo '#deployment.properties' > /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update.locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update=false >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER"=true >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER"=later >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Wrote content to deployment.properties file.  Have a wonderful day."

                                else


                                            /bin/echo "deployment.properties file already exists.  Removing and building new version..."


                                    # Delete existing version of the file
                                            /bin/rm -f /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Deleted previous deployment.properties file"


                                    # Create deployment.properties file
                                        /usr/bin/touch /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Created deployment.properties file"


                                    # Change ownership on this new file
                                        /usr/sbin/chown root:wheel /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed ownership on deployment.properties file"


                                    # Change permissions on this file
                                        /bin/chmod 755 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed permissions on deployment.properties file"


                                    # Write contents of this file
                                        /bin/echo '#deployment.properties' > /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update.locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update=false >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER"=true >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER"=later >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Wrote content to deployment.properties file.  Have a wonderful day."


                        fi

        else
                echo "Error: Failure to find Java Plugin path.  Either Java is not installed, or the path within the plugin has changed. Exiting"

        fi



/bin/echo "Finished running disable_java_updates script"

####################################################################################################
####################################################################################################

Forum|alt.badge.img+5
  • New Contributor
  • 62 replies
  • February 21, 2013

There seem to be a few places you can set deployment.macosx settings in the deployment.properties files.

Have you verified that this actually prevents the Sparkle Java updater dialog from popping up at the time that's scheduled in /Library/LaunchAgents/com.oracle.Java.Java-Updater.plist? In my tests, it doesn't.

Oracle changed the update mechanism to one that's much more clever starting in Update 11, and I'm convinced that it has zero connection to any of these Java-style properties configuration files.


Forum|alt.badge.img+8

If you trash that Launch Agent, does it get re-created at some point? In a quick test, it doesn't look like it gets created at reboot.


Forum|alt.badge.img+31
  • Employee
  • 920 replies
  • February 21, 2013

The launch agent will be re-installed (unless Oracle changes this) with the next Java update.


Forum|alt.badge.img+5
  • New Contributor
  • 62 replies
  • February 21, 2013

No, it doesn't. My current method of disabling the updater is to remove the symlink it creates in /Library/LaunchAgents, so that it doesn't run this anymore on a reboot. It would be nice if there

Also a correction: this new "Helper-Tool" rewrite-the-LaunchAgent trickery shipped with Update 10, not 11. I posted to MacE about this when it was released, posting one method and amending it a week later when I realized it would break future versions from correctly installing due to a naïve assumption by the installer's postinstall script:

https://groups.google.com/forum/#!topic/macenterprise/Vjoe-qo1ttA/discussion


Forum|alt.badge.img+8

So, for the Sparkle pop up, it sounds like the way to go is to also remove the Launch Agent after every Java update- as long as they continue to throw it in there as part of the install. Is that what you're doing?


Forum|alt.badge.img+5
  • New Contributor
  • 62 replies
  • February 22, 2013

Yes. But I only remove the symlink, leaving the original files alone.


Forum|alt.badge.img+8

Here's a revised version that will remove the Launch Agent if it exists, as well as create the deployment.properties file if it doesn't exist. This could be run after you run the Java updates because it will exit if the deployment.properties file already exists.

I edited the script above as well to include this.

(Edited and modified on 3-2-13 to include suppressing the update prompt when using a Java app)

#!/bin/bash


####################################################################################################
# Creates pref file for Java 7 that has setting which turns off the auto update check feature
# Created by AS (3-2-13)
####################################################################################################
####################################################################################################



/bin/echo "Beginning running disable_java_updates script"


####################################################################################################
# Get number variable needed to set suppression of update reminder
####################################################################################################

NUMBER=`/bin/cat /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled.plist |grep ';deploy=' |cut -d"=" -f2 |cut -d"<" -f1`

    echo The number for suppression of this version of Java is "$NUMBER"


    # Verify that it received a numeric value

        case "$NUMBER" in 
        [0-9]*) 
                echo "Entry is a numeric value.  Continuing..."
                ;;
        * ) 
                echo "Error: This entry is not a number.  Will fail to properly suppress update pop up."
                ;;
        esac



####################################################################################################
# Remove Updater Launch Agent Sym Link that gets created during updates
####################################################################################################

    /bin/echo "Checking to see if Launch Agent sym link exists..."

        if [ -f /Library/LaunchAgents/com.oracle.java.Java-Updater.plist ]; then

            /bin/echo "Launch Agent exists.  Removing."

            /bin/rm /Library/LaunchAgents/com.oracle.java.Java-Updater.plist

            /bin/echo "Removed Update Launch Agent Sym Link"

        else
                    /bin/echo "Launch Agent does not exist."

        fi


####################################################################################################
# Remove Updater Launch Daemon Sym Link that gets created during updates
####################################################################################################

    /bin/echo "Checking to see if Launch Daemon sym link exists..."

        if [ -f /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist ]; then

            /bin/echo "Launch Daemon exists.  Removing."

            /bin/rm /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist

            /bin/echo "Removed Update Launch Daemon Sym Link"

        else
                    /bin/echo "Launch Daemon does not exist."

        fi


####################################################################################################
####################################################################################################


        # Check to see if Java Plugin exists
        if [ -d /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home ]; then


                echo "Java Plugin is installed, continuing..."


                        if [ ! -f /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties ]; then

                                /bin/echo "The deployment.properties file does not yet exist.  Will create..."


                                    # Create deployment.properties file
                                        /usr/bin/touch /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Created deployment.properties file"


                                    # Change ownership on this new file
                                        /usr/sbin/chown root:wheel /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed ownership on deployment.properties file"


                                    # Change permissions on this file
                                        /bin/chmod 755 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed permissions on deployment.properties file"


                                    # Write contents of this file
                                        /bin/echo '#deployment.properties' > /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update.locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update=false >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER"=true >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER"=later >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Wrote content to deployment.properties file.  Have a wonderful day."

                                else


                                            /bin/echo "deployment.properties file already exists.  Removing and building new version..."


                                    # Delete existing version of the file
                                            /bin/rm -f /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Deleted previous deployment.properties file"


                                    # Create deployment.properties file
                                        /usr/bin/touch /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Created deployment.properties file"


                                    # Change ownership on this new file
                                        /usr/sbin/chown root:wheel /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed ownership on deployment.properties file"


                                    # Change permissions on this file
                                        /bin/chmod 755 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Changed permissions on deployment.properties file"


                                    # Write contents of this file
                                        /bin/echo '#deployment.properties' > /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update.locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.macosx.check.update=false >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision.suppression."$NUMBER"=true >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER".locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.decision."$NUMBER"=later >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Wrote content to deployment.properties file.  Have a wonderful day."


                        fi

        else
                echo "Error: Failure to find Java Plugin path.  Either Java is not installed, or the path within the plugin has changed. Exiting"

        fi



/bin/echo "Finished running disable_java_updates script"

####################################################################################################
####################################################################################################

Forum|alt.badge.img+8

So it's become apparent that trying to suppress all of the different update prompt mechanisms that Oracle is using will be an ongoing, trial and error battle... until they change things. Previously, the script was unchecking the "Check for Updates" option and removing the Launch Agent that checks for updates periodically. However, if you were still on an older version of the plugin, it would prompt to update when you opened a Java app.

I updated the script now to add some more keys to the deployment.properties file. This appears to suppress the update prompt when opening a Java app. The keys use a version specific number, so I'm grabbing that number from a file within the plugin and using as a variable... hopefully allowing us to be able to continue using the script every time we roll out a new version of Java. Unfortunately, we have to run the script after every Java update. Hopefully Oracle will give us some better options for controlling this in the future.

Let me know if anyone has any better ideas, or ways to improve on this way of doing it. Any time I update/modify the script, I'm editing the previous versions on this thread in case people grab those copies. For the updated version that also suppresses the prompt when using an app, see either of the previous posts containing the script.


Forum|alt.badge.img+17
  • Honored Contributor
  • 1143 replies
  • May 7, 2013

Anyone know if the script above from @andrew_stenehjem disables java auto update on current version (7u21)?

Thanks!


Forum|alt.badge.img+5
  • New Contributor
  • 62 replies
  • May 7, 2013

@CasperSally:

It should. If you read the script, you'll see that much of the work it does involves inserting a value into the preferences file that's dynamically derived from the version string (somewhere) in the installed version. So, since there's no hardcoded version it should work for every version until they change their versioning mechanism/location.


Forum|alt.badge.img+12
  • Employee
  • 128 replies
  • June 3, 2013

Thanks for sharing this.

Does anyone happen to have an EA that reports whether the "Check for Updates" box is checked or not? If not I can try to weed may way through this to see if I can create one.


Forum|alt.badge.img+1
  • New Contributor
  • 3 replies
  • September 11, 2013

It looks like the method for disabling automatic updates has changed again in Java 7 Update 40 and the old fixes no longer seem to work. Has anyone had any luck?


jconte
Forum|alt.badge.img+12
  • Valued Contributor
  • 131 replies
  • September 12, 2013

I am having the same problem disabling the updates in Java 7 Update 40. If I figure it out I will post here.
Thanks


Forum|alt.badge.img+1
  • New Contributor
  • 3 replies
  • September 12, 2013

I'm not sure if all the changes to deployment.properties are still needed, but doing the following seems to work (at least it un-checks the Check for Updates Automatically box.)

sudo defaults write /Library/Preferences/com.oracle.java.Java-Updater JavaAutoUpdateEnabled -bool false

Important
I had issues when I tried to unload and delete the Launch Agent/Daemons like I have done in the past. Maybe I did something incorrectly ( or in the wrong order ) but when I attempted to remove the launch items, the Java preferences would take forever to load and the updates checkbox would remain checked.


Forum|alt.badge.img+8
  • Author
  • Contributor
  • 117 replies
  • September 12, 2013

Good call jtrater. I added the defaults command to the existing script and it worked for me. I also don't know if we still need to do all of the modification to the deployment.properties file.


ega
Forum|alt.badge.img+16
  • Valued Contributor
  • 141 replies
  • September 13, 2013

So this defaults command seems to stop checking for updates. Does anyone know the settings needed for automatic, unattended, silent update? With Flash we can get this using mms.cfg effectively making Flash silently and continuously update itself (automated patch management)... I would love to have this for Java. Ideas?


Forum|alt.badge.img+9
  • Valued Contributor
  • 187 replies
  • September 13, 2013

Thumbs up on jtrater's input


Forum|alt.badge.img+1
  • New Contributor
  • 7 replies
  • September 16, 2013

I am new to editing scripts, where exactly in the script do I need to edit jtrater's fix to turn off auto updates for Java 7 Update 40?

Thanks,

Andrew


Forum|alt.badge.img+6
  • Contributor
  • 49 replies
  • September 16, 2013

jtrater - Your plist update worked for me! Appreciate the info.


Forum|alt.badge.img+10
  • Contributor
  • 194 replies
  • September 17, 2013

Just for my two cents, this seemed to be having issues, so I went the sneaky route and pointed the software update URL to the machine. Sparkle fails quietly now, user only sees that it couldn't connect to the server. There's more to the script (I took the sledgehammer approach), but here's the relevant lines. I consider it my backup to my backup of the disabling script.

#!/bin/sh
disabledPlistPath="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Disabled"
enabledPlistPath="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Enabled"

   defaults write "${disabledPlistPath}" SUFeedURL "http://127.0.0.1"
   defaults write "${enabledPlistPath}" SUFeedURL "http://127.0.0.1"

Forum|alt.badge.img+13
  • Contributor
  • 400 replies
  • October 8, 2013

@andrew_stenehjem

There's a new key introduced;

deployment.expiration.check.enabled

http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/properties.html

I think this will replace the deployment.expiration.decision.xxxx key since Java 7 Update 40.


Forum|alt.badge.img+7
  • Contributor
  • 36 replies
  • October 8, 2013

Ok, I'm just wondering....
You can install Java, make the changes after a snapshot then package it as a .dmg and enable FEU and FUT (as per need). Wouldn't that work too? I have done something similar where in I had to enter a site to the allow list of Flash for a bunch of carts. I followed the above workflow and it worked.


Forum|alt.badge.img+8

Thanks @Kumarasinghe. Currently, our deployment properties file gets the following keys:

#deployment.properties
deployment.macosx.check.update.locked
deployment.macosx.check.update=false
deployment.expiration.decision.suppression.10.40.2.locked
deployment.expiration.decision.suppression.10.40.2=true
deployment.expiration.decision.10.40.2.locked
deployment.expiration.decision.10.40.2=later

Any idea if the new key needs to have the version number included (hopefully not), and whether they replace all of the deployment.expiration.decision entries including the "suppression" entry? For example, is this what we'd like to now include in the deployment.properties file?

#deployment.properties
deployment.macosx.check.update.locked
deployment.macosx.check.update=false
deployment.expiration.check.enabled.locked
deployment.expiration.check.enabled=false

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