Skip to main content
Question

Java 7 Preferences


Show first post

57 replies

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

@andrew_stenehjem
I'm not too sure. I haven't tested it thoroughly yet but this is a thread from Java for Windows with that option.
http://www.labareweb.com/java-1-7-auto-update-deployment-with-sccmmdt/


Forum|alt.badge.img+8

Looks like we don't need the version included with the new key: http://www.oracle.com/technetwork/java/javase/7u40-relnotes-2004172.html#newft

I'm gonna go with this for now and see how it works when the next update is released:

#!/bin/bash


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



/bin/echo "Beginning running disable_java_updates script"

####################################################################################################
# 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

                                        # New key as of update 40
                                        /bin/echo deployment.expiration.check.enabled.locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.check.enabled=false >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Wrote content to deployment.properties file."

                                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

                                        # New key as of update 40
                                        /bin/echo deployment.expiration.check.enabled.locked >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties
                                        /bin/echo deployment.expiration.check.enabled=false >> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/deployment.properties

                                            /bin/echo "Wrote content to deployment.properties file."


                        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



        # Change the auto updater preference
        /usr/bin/defaults write /Library/Preferences/com.oracle.java.Java-Updater JavaAutoUpdateEnabled -bool false

            /bin/echo "Changed the auto updater preference file.  Have a wonderful day."



/bin/echo "Finished running disable_java_updates script"

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

Forum|alt.badge.img+12
  • Valued Contributor
  • 181 replies
  • October 17, 2013

Thanks for this, not if there were only something similar to disable the Google updates.


Forum|alt.badge.img+4
  • Contributor
  • 14 replies
  • October 18, 2013

As jconte pointed out, I believe there is a change in the way 7.40 behaves with updates. I could not get the deployment.macosx.check.update=false command to disable the updates on 7.40, but it did work with 7.25. (Well, maybe it did work on 7.40, but the infamous checkbox remained.)

The suggestion from jrater on using the "sudo defaults write /Library/Preferences/com.oracle.java.Java-Updater JavaAutoUpdateEnabled -bool false" command were spot on. That disabled the checkbox and disabled the automatic update check. Doing this also creates a PLIST file that makes remote deployment a breeze.

Any suggestions on using this same PLIST to change the default security settings or expiration check? I would ideally like to just deploy the single PLIST file instead of also using the deployment.properties file. Is there a way to see exactly what "defaults" options are available?

Hopefully this is a sign that Oracle is adopting the standard PLIST settings deployment that everyone else uses...


Forum|alt.badge.img+12
  • Contributor
  • 417 replies
  • October 18, 2013

Ay ideas for those of us still on 1.7.0_11 that are just now starting to get the update prompt again? It's been suppressed for 7 months now, and just last week I started getting Sparkle update pop-ups again :(

Would the old client utilize these new keys?

EDIT: After some more testing, it seems like it's defaulting to using the deployment.properties file in ~/Library/App Support/Oracle/Java/Deployment. How can I get it to NOT do that?

Contents of this file:

#deployment.properties
#Fri Oct 18 16:42:23 EDT 2013
deployment.modified.timestamp=1382128943721
deployment.version=7.0
deployment.expiration.decision.timestamp.10.11.2=10/18/2013 16:34:38
#Java Deployment jre's
#Fri Oct 18 16:42:23 EDT 2013
deployment.javaws.jre.0.registered=false
deployment.javaws.jre.0.platform=1.7
deployment.javaws.jre.0.osname=Mac OS X
deployment.javaws.jre.0.path=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
deployment.javaws.jre.0.product=1.7.0_11
deployment.javaws.jre.0.osarch=x86_64
deployment.javaws.jre.0.location=http://java.sun.com/products/autodl/j2se
deployment.javaws.jre.0.enabled=true
deployment.javaws.jre.0.args=

I did add the deployment.properties file from the script above into the user template, and java is still overwriting it and prompting for an update.


antoinekinch11
Forum|alt.badge.img+9

Does this work for deploying a Safari white list in Safari 6.1 and enabling websites to run in unsafe mode?


Forum|alt.badge.img+5
  • Contributor
  • 14 replies
  • November 18, 2013

Looks as if the documentation Oracle provides to manage enterprise level Macs is inaccurate. Just took me all of Friday to dig in and correctly setup system wide settings. Using the script already provided I have added some tweaks and also the creation of system wide config and properties file.

If you look at the documentation link below, you can add/remove options that get written to properties file.
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/properties.html

Note that the system wide config location is incorrect and correct one should be under /Library and not ~/Library in Oracle's documentation.

Also please note the properties file can be placed anywhere on the local Mac the location I chose is inside the same config location.

Script below:

#!/bin/sh

# Java Plugin Location 
javaPlugin="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin"

# Config File Location
configFile="/Library/Application Support/Oracle/Java/Deployment/deployment.config"

# Properties File Location
propFile="/Library/Application Support/Oracle/Java/Deployment/deployment.properties"

# Checks if Java Plugin is installed
if [ -e "$javaPlugin" ]; then

    /bin/echo "Java Plugin is installed..."

    # Checks if config file is present
    if [ ! -f "$configFile" ]; then

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

            # Create deployment.config file
            /usr/bin/touch "$configFile"

            /bin/echo "Created deployment.config file"

            # Change ownership on this new file
            /usr/sbin/chown root:wheel "$configFile"

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

            # Write contents of this file
            /bin/echo deployment.system.config=file://$propFile >> "$configFile"
            /bin/echo deployment.system.config.mandatory=false >> "$configFile"

            /bin/echo "Wrote content to deployment.config file."

    else

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

            # Delete existing version of the file
            /bin/rm -f "$configFile"

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

            # Create deployment.config file
            /usr/bin/touch "$configFile"

            /bin/echo "Created deployment.config file"

            # Change ownership on this new file
            /usr/sbin/chown root:wheel "$configFile"

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

            # Write contents of this file
            /bin/echo deployment.system.config=file://$propFile >> "$configFile"
            /bin/echo deployment.system.config.mandatory=false >> "$configFile"

            /bin/echo "Wrote content to deployment.config file."

    fi

    # Checks if properties file is present
    if [ ! -f "$propFile" ]; then

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

            # Create deployment.properties file
            /usr/bin/touch "$propFile"

            /bin/echo "Created deployment.properties file"

            # Change ownership on this new file
            /usr/sbin/chown root:wheel "$propFile"

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

            # Write contents of this file
            /bin/echo '#deployment.properties' > "$propFile"
            /bin/echo deployment.security.validation.ocsp=false >> "$propFile"
            /bin/echo deployment.security.validation.ocsp.locked >> "$propFile"
            /bin/echo deployment.macosx.check.update=false >> "$propFile"
            /bin/echo deployment.macosx.check.update.locked >> "$propFile"
            /bin/echo deployment.expiration.check.enabled=false >> "$propFile"
            /bin/echo deployment.expiration.check.enabled.locked >> "$propFile"                                                             
            /bin/echo deployment.console.startup.mode=HIDE >> "$propFile"

            /bin/echo "Wrote content to deployment.properties file."

    else

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

            # Delete existing version of the file
            /bin/rm -f "$propFile"

            # Create deployment.properties file
            /usr/bin/touch "$propFile"

            /bin/echo "Created deployment.properties file"

            # Change ownership on this new file
            /usr/sbin/chown root:wheel "$propFile"

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

            # Write contents of this file
            /bin/echo '#deployment.properties' > "$propFile"
            /bin/echo deployment.security.validation.ocsp=false >> "$propFile"
            /bin/echo deployment.security.validation.ocsp.locked >> "$propFile"
            /bin/echo deployment.macosx.check.update=false >> "$propFile"
            /bin/echo deployment.macosx.check.update.locked >> "$propFile"
            /bin/echo deployment.expiration.check.enabled=false >> "$propFile"
            /bin/echo deployment.expiration.check.enabled.locked >> "$propFile"                                                             
            /bin/echo deployment.console.startup.mode=HIDE >> "$propFile"

            /bin/echo "Wrote content to deployment.properties file."

    fi

    # Change the auto updater preference
    /usr/bin/defaults write /Library/Preferences/com.oracle.java.Java-Updater JavaAutoUpdateEnabled -bool false

    /bin/echo "Changed the auto updater preference file."
    /bin/echo "Java settings have been deployed. Exiting"

else

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

fi

Forum|alt.badge.img+13
  • Contributor
  • 400 replies
  • November 20, 2013

@acostj please check your script. /usr/bin/touch "$configFile" wouldn't work as the Deployment folder doesn't exist in "/Library/Application Support/Oracle/Java/"

Thanks


Forum|alt.badge.img+8
  • Contributor
  • 58 replies
  • November 21, 2013

Just to throw my hat in the ring, here's the template I use to install a particular version of Java 7, set the deployment preferences and ensure the updater will not run:

https://github.com/bmwarren/oracle-java-deployment

Basically a Packages project with a postflight script that installs Java itself and deployment prefs. You'll need to bring your own Java installer, and instructions are in the README.


antoinekinch11
Forum|alt.badge.img+9

Given the new Java 7 update 51, the default security level is HIGH. Is there a way to just set the security level to Medium with a simple script?

sudo defaults write /Library/Application Support/Oracle/Java/Deployment/deployment.properties deployment.security.level -bool MEDIUM or WEB_JAVA_SECURITY_LEVEL=M or something like that?

Thanks.


Forum|alt.badge.img+9
  • Contributor
  • 145 replies
  • February 28, 2014

Okay so I ran this script on my own machine to test. Seemed to execute fine but the box to check for auto-updates is still checked in the Java control panel. Is that anything to be concerned with?


antoinekinch11
Forum|alt.badge.img+9

To disable auto updates run this command:

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

@johnnasset


Forum|alt.badge.img+7
  • Contributor
  • 52 replies
  • April 16, 2014

Hey

Just pulling up this thread, ive noticed Java 7 Update 55 has been released today. What was the best method to disable the Auto updating, via the script or command above?


Forum|alt.badge.img+6
  • Contributor
  • 49 replies
  • April 23, 2014

Likewise. I'm looking for a way to disable Auto updating in Update 55. GUI method doesn't appear to work.


Forum|alt.badge.img+9
  • Contributor
  • 145 replies
  • April 23, 2014

The above command still works in update 55:

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


Forum|alt.badge.img+15
  • Contributor
  • 208 replies
  • May 9, 2014

@bajankinch did you get this working?

sudo defaults write /Library/Application Support/Oracle/Java/Deployment/deployment.properties deployment.security.level -bool MEDIUM or WEB_JAVA_SECURITY_LEVEL=M or something like that?

trying to accomplish the same, but it seems as if this setting is set on the ~/Library/Preferences/com.oracle.javadeployment.plist

I'm having troubles getting the Key deployment.security.level with the string MEDIUM placed in the /com/oracle/javadeployment/ dictionary


Forum|alt.badge.img+1
  • New Contributor
  • 3 replies
  • May 12, 2014

There, may be an easier way, but we are deploying a Java preferences package that contains

/Library/Application Support/Oracle/Java/Deployment/deployment.properties

deployment.properties has a line that reads deployment.security.level=MEDIUM

You could also create that file via a script.


Forum|alt.badge.img+7

@maktime
I tried a combo of the suggestions on this thread. I have only tested on a couple machines, but this seems to work. create MCX based off of the defaults command here
/Library/Preferences/com.oracle.java.Java-Updater JavaAutoUpdateEnabled -bool false

Computer level enforced
Value com.oracle.java.Java-Updater Key JavaAutoUpdateEnabled
bool false

To get this to work, i had to run the defaults command once to create the plist file. After that, the MCX would revert the setting of the check box, if checked again. I have not tested long enough to see if i get a pop up prompt though, but it looks like a step in the right direction.


Forum|alt.badge.img+4
  • Contributor
  • 13 replies
  • August 12, 2014

@bmwarren

Just to throw my hat in the ring, here's the template I use to install a particular version of Java 7

how can I add my own deployment.properties file? I saw you included the source file for Oracle_Java_Preferences, but how I convert that into a pkg?


Forum|alt.badge.img+8
  • Contributor
  • 58 replies
  • August 13, 2014

@gpalau

You'll need to build it as a pkg yourself using your favorite packaging tool; since we're already using Packages it makes since to use that here too. Composer will also work.

You can see my deployment.properties at https://github.com/haircut/oracle-java-deployment/blob/master/deployment_preferences/Oracle_Java_Preferences/ROOT/Library/Application%20Support/Oracle/Java/Deployment/deployment.properties

Build your package to install your deployment.properties to the correct path (/Library/Application Support/Oracle/Java/Deployment) with your customized file. If you're using Composer, create a snapshot, move the file to the correct path, then build your package making sure it only includes deployment.properties and deployment.config.


Forum|alt.badge.img+15
  • Contributor
  • 208 replies
  • August 13, 2014

@gpalau we did almost the same as @bmwarren. We ended up packaging the deployment.properties and deployment.config in a DMG. We have the package offered in self service as well.
Path was /Library/Application Support/Oracle/Java/Deployment/

#deployment.config
#Tue May 13 20:51:30 CDT 2014
deployment.system.config=file:///Library/Application Support/Oracle/Java/Deployment/deployment.properties
deployment.system.config.mandatory=true

#deployment.properties
#Tue May 13 20:51:30 CDT 2014
deployment.macosx.check.update=false
deployment.macosx.check.update.locked
deployment.expiration.check.enabled=false
deployment.expiration.check.enabled.locked
deployment.security.level=MEDIUM
deployment.security.level.locked
deployment.console.startup.mode=HIDE

It's worked in the past few releases and the latest 7r 67

Dan


Forum|alt.badge.img+4
  • Contributor
  • 13 replies
  • August 19, 2014
You'll need to build it as a pkg yourself using your favorite packaging tool; since we're already using Packages it makes since to use that here too. Composer will also work. You can see my deployment.properties at https://github.com/haircut/oracle-java-deployment/blob/master/deployment_preferences/Oracle_Java_Preferences/ROOT/Library/Application%20Support/Oracle/Java/Deployment/deployment.properties Build your package to install your deployment.properties to the correct path (/Library/Application Support/Oracle/Java/Deployment) with your customized file. If you're using Composer, create a snapshot, move the file to the correct path, then build your package making sure it only includes deployment.properties and deployment.config.

@bmwarren one last question, how can I create a pkg (I have never done this before) of deployment.config and deployment.properties with Packages?


Forum|alt.badge.img+2
  • New Contributor
  • 12 replies
  • August 21, 2014

@gpalau][/url I still think the easiest and most flexible way is Apple Package Maker. You have to search and install the auxiliary tools for xcode off developer.apple.com. But watch this video for a quick overview, you basically make a folder called root and then under that lay out a dummy file system like on OS X. Under Root you would have Library or System and so on. Create the whole directory structure and then put the files in place and drag the folder named root or Package in the video and set the prefs and change the names and add any Read Me info or background and create the package. Not really sure why Apple gave up on Package Maker, its still my favorite to create packages with. http://youtu.be/jpP3UbKsKT0


Forum|alt.badge.img+6
  • Contributor
  • 16 replies
  • January 13, 2015

I've got the deployment.config and deployment.properties files working, except Auto Update does not actually turn off. The other settings in the deployment.properties file are applied. This is on 10.9.5 using both Java 7 and Java 8 (latest releases). After some research I found this bug which is still open and unresolved. So in case anyone else is struggling to figure out what the problem is, here you go: https://bugs.openjdk.java.net/browse/JDK-8029309


Forum|alt.badge.img+16
  • Valued Contributor
  • 401 replies
  • February 20, 2015

All of this looks like it's for managing the auto-update and alerts (which is good, and I'm adopting). But, has someone written a script to check for and install updated Java version that I can run through Self-Service? Something like the Flash update script.


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