This discussion is archived
5 Replies Latest reply: Sep 17, 2013 8:05 AM by tmm72 RSS

How to change a setting in the Java Control Panel with command line

900136 Newbie
Currently Being Moderated
Hi,

I am trying to figure out how to change a setting in the Java Control Panel with command line or with a script. I want to enable "Use SSL 2.0 compatible ClientHello format"

I can't seem to find any documentation on how to change settings in the Java Control Panel via the command line

Edited by: 897133 on Nov 14, 2011 7:15 AM
  • 1. Re: How to change a setting in the Java Control Panel with command line
    baftos Expert
    Currently Being Moderated
    Can't find the equivalent for 1.6, but check this:
    http://download.oracle.com/javase/1,5.0/docs/guide/deployment/deployment-guide/properties.html
  • 2. Re: How to change a setting in the Java Control Panel with command line
    900136 Newbie
    Currently Being Moderated
    OK figured it out. This is for the next person seeking the same solution.

    When you click on the Java Control Panel (found in the Control panel) in any version of Windows, it first looks for a System Wide Java Configuration (found here: C:\Windows\Sun\Java\Deployment). At this point you must be wondering why you don't have this folder (C:\Windows\Sun\Java\Deployment) or why its empty. Well, for an enterprise environment, you have to create it and place something in it - it doesn't exist by default. So you'll need a script (I used Autoit) to create the directory structure and place the the two files into it. The two files are "deployment.properties" and "deployment.config".

    Example: When you click on the Java Control Panel it first checks to see if this directory exists (C:\Windows\Sun\Java\Deployment) and then checks if there is a "deployment.config". If there is one it opens it and reads it. If it doesn't exist, Java creates user settings found here C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7.

    __deployment.config__

    It should look like this inside:

    *#deployment.config*
    *#Mon Nov 14 13:06:38 AST 2011*
    *# The First line below specifies if this config is mandatory which is simple enough*
    *# The second line just tells Java where to the properties of your Java Configuration*
    *# NOTE: These java settings will be applied to each user file and will overwrite existing ones*
    deployment.system.config.mandatory=True
    deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties

    If you look in C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7 for example you will find "deployment.properties". You can use this as your default example and add your settings to it.

    How?

    Easy. If you want to add *"Use SSL 2.0 compatible ClientHello format"*

    Add this line:

    deployment.security.SSLv2Hello=true

    Maybe you want to disable Java update (which is a big problem for enterprises)

    Add these lines:

    deployment.javaws.autodownload=NEVER
    deployment.javaws.autodownload.locked=


    Below is a basic AutoIt script you could use (It compiles the files into the executable. When you compile the script the two Java files must be in the directory you specify in the FileInstall line, which can be anything you choose. It will also create your directory structure):

    #NoTrayIcon
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****




    Func _JavaConfig()

         $ConfigFile_1 = @TempDir & "\deployment.properties"
         $ConfigFile_2 = @TempDir & "\deployment.config"

         FileInstall ("D:\My Documents\Autoit\Java config\deployment.properties", $ConfigFile_1)
    FileInstall ("D:\My Documents\Autoit\Java config\deployment.config", $ConfigFile_2)

         FileCopy($ConfigFile_1, @WindowsDir & "\Sun\Java\Deployment\", 9)
         FileCopy($ConfigFile_2, @WindowsDir & "\Sun\Java\Deployment\", 9)
         Sleep(10000)
         FileDelete(@TempDir & "\deployment.properties")
         FileDelete(@TempDir & "\deployment.config")

    EndFunc

    _JavaConfig()

    Now if you have SCUP and have setup Self Cert for your organization, you just need to create a SCUP update for JRE.

    Edited by: 897133 on Nov 16, 2011 4:53 AM
  • 3. Re: How to change a setting in the Java Control Panel with command line
    989337 Newbie
    Currently Being Moderated
    I have installed version Java 7 update 11. I have setup the process described in the last post, but my deployment.config file is being ignored when I go into the Java Control Panel. A new deployment.config is then created in my user profile.

    The Java 7 control panel looks a bit different from the Java 6 one that worked fine with the enterprise deployment.config

    Thank
    Jane
  • 4. Re: How to change a setting in the Java Control Panel with command line
    01a62782-e06d-49c4-8331-f51df5c700a5 Newbie
    Currently Being Moderated


    I came across this article looking for a way to set the ssl 2.0 setting to be enabled for all users due to some in house java programs we use.

     

    I wasn't able to get it to work with the above suggestion, with both a .config and a .properties file. I was however able to have some better luck putting the "deployment.security.SSLv2Hello=true" within the .properties file instead. I was having major issues with my user profiles, or it just plain didn't work, regardless of many things i had tried, but this one worked pefrectly (so far) and i'm using 7 update 25 at the moment with it.

     

    Here's the content of my deployment.properties file, which i did still put in C:\Windows\Sun\Java\Deployment.

     

     

    #deployment.properties

    #Tue Jul 16 11:16:28 EDT 2013

    deployment.modified.timestamp=1373987788162

    deployment.version=7.21

    deployment.browser.path=C\:\\Program Files\\Internet Explorer\\iexplore.exe

    #Java Deployment jre's

    #Tue Jul 16 11:16:28 EDT 2013

    deployment.javaws.jre.0.registered=true

    deployment.javaws.jre.0.platform=1.7

    deployment.javaws.jre.0.osname=Windows

    deployment.javaws.jre.0.path=C\:\\Program Files\\Java\\jre7\\bin\\javaw.exe

    deployment.javaws.jre.0.product=1.7.0_25

    deployment.javaws.jre.0.osarch=x86

    deployment.javaws.jre.0.location=http\://java.sun.com/products/autodl/j2se

    deployment.javaws.jre.0.enabled=true

    deployment.javaws.jre.0.args=

    deployment.security.SSLv2Hello=true

     

    Also, if you are trying to disable updates\auto updates, just go into the registry to disable it. HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy and change anything about update from a 1 to a 0.

  • 5. Re: How to change a setting in the Java Control Panel with command line
    tmm72 Newbie
    Currently Being Moderated

    I was wondering do you need to put in all the setting in the deployment.config file or can you just put in the line that you want to change?

     

    I only have one setting to change and that would be it.


    TM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points