5 Replies Latest reply: Sep 17, 2013 10:05 AM by tmm72 RSS

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


      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
          Can't find the equivalent for 1.6, but check this:
          • 2. Re: How to change a setting in the Java Control Panel with command line
            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.


            It should look like this inside:

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

            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.


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

            Add this line:


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

            Add these lines:


            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):

            #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
            #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)
                 FileDelete(@TempDir & "\deployment.properties")
                 FileDelete(@TempDir & "\deployment.config")



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

              • 4. Re: How to change a setting in the Java Control Panel with command line

                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.




                #Tue Jul 16 11:16:28 EDT 2013



                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.path=C\:\\Program Files\\Java\\jre7\\bin\\javaw.exe








                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

                  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.