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

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

October 11Hits:6
Advertisement
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

Answers

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

Read other 6 answers

Tags:

Related Articles

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.490 s.