How can I change the Java Control Panel selection (corresponding to deployment.properties file) from Windows Command Prompt?

How can I change the Java Control Panel selection (corresponding to deployment.properties file) from Windows Command Prompt? Specifically, I'm looking for a command that can affect a change in "Action for local applets"

in the window "Custom Security Level Settings"

(click the Settings ... button next to the Custom setting for the Security Level slider in the Security Tab in the Java Control Panel), from "Prompt user"

to"Run without prompt"

... This default value changed with Java 7 Update 11 and it interferes with the Automated Test Program which I am fixing now when the Security Warning dialog appears when IE launches java.exe, unless this Java Control Panel Customization is configured a priori. This test program launches IE to run a local Java applet that is written using AWT and does not have access to any websites.

Please note: This issue was discussed recently - see https://service.parachat.com/knowledgebase/273/I-see-a-Do-you-want-to-run-this-application-security-warning.html

For my task, manually changing this control panel setting is the least desirable way to solve the problem, since the program I am patching is part of an automated test suite that is deployed to many machines and requires manual intervention making the deployment process unacceptable. I need these commands to run from a windows command line batch file.

I found that these security level settings are written to the Java deployment.properties file and in the 2 Windows registry under keys with names ending with the "Software\JavaSoft\DeploymentProperties".

deployment.properties file is discussed in detail in Oracle Java SE Documentation "Deployment Configuration File and Properties" but nothing is mentioned oh "Action for local applets"

maybe because this property is a recent addition (?) When I configure the Java security level and "Action for local applets"

in the Java Control Panel, I see the changes reflected in the deployment.properties file as well as the DeploymentProperties registry keys.

So I can do the following:

  • edit deployment.properties file via script (keep original)
  • start Java control panel via script - I noticed that this copies updates from deployment.properties file to DeploymentProperties registry keys
  • terminating the javaw process that launches the Java Control Panel

    • then run the program which uses my local Java applet in IE
    • then revert the deployment.properties file to its original state, start the Java control panel via script and end the javaw process that launches the Java control panel.

I also tried it the other way around - update the registry key, but the file hasn't changed and the Java Control Panel will return the registry value set to match the unmodified deployment.properties file! Therefore, updating registry keys is the wrong way.

Is there a better way to do this? My 3 step solution above (for changing properties) is the kluge for what it should execute. Is there a Java command line utility that can change this deployment property? Is there a way to pass these JVM deployment properties using the applet tag attributes to be effective only within a given Java applet?

I have used Windows XP (32-bit & 64-bit) and Windows 7 (64-bit) and Internet Explorer 7, 8 and 9. It would be nice to have a (simple) solution that works on Windows XP, Windows Vista, Windows 7 and Windows 8.

+3


source to share


4 answers


Just create your own deployment.properties file and place it in * {User Application Data Folder} \ LocalLow \ Sun \ Java \ Deployment *. Or edit an existing file. You need to restart your internet browser.



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

+1


source


Install it during installation according to the following article:

http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/client-security.html

When set, the WEB_JAVA_SECURITY_LEVEL argument has the following effect:



WEB_JAVA_SECURITY_LEVEL=VH sets the security level to very high
WEB_JAVA_SECURITY_LEVEL=H sets the security level to high
WEB_JAVA_SECURITY_LEVEL=M sets the security level to medium
WEB_JAVA_SECURITY_LEVEL=L sets the security level to low

      

After installing the JRE, check the security level settings in the Java Control Panel.

0


source


I have tested with java 7u25

When placed here deploy.properties C: \ Windows \ Sun \ Java \ deployments \ deployment.properties

The next time javaw is launched or the control panel is opened (javaw is also launched), the new settings take effect.

In theory you should discard the new deployment.properties file with a script, run the application right away. Close the application. Then copy the original deployment.properties file to restore the security settings.

I would also like to mention that you can get rid of the "Do you want to run this application" field by changing the location of the trust store in the shared location. By placing in it the file trusted.certs, which was generated manually, approving the certificate on any other computer. Note that the extra slashes are required because the colon is a reserved character and the backslash is an escape character.

#moves the user trusted certificates store to a shared location so we can pre-approve controls
deployment.user.security.trusted.certs=C\:\\Program Files\\Java\\jre7\\security\\trusted.certs

      

0


source


Just search for "Configure Java" which will open the "Java Control Panel". The file is located in the JRE folder.

OR, you can go to Control Panel and click on the Java icon.

It simply decreases or increases the level of security at your request.

Hope I helped.

To have a good day.:)

0


source







All Articles