With Java 7 Update 45, the System Properties no Longer Set from JNLP Tag “Property”

We experienced the same Problem with Java 7 Update 45 (1.7.0_45). The JNLP Spec gave a hint for a work-around:

Properties set in the jnlp file will normally be set by Java Web Start after the VM is started but before the application is invoked. Some properties are considered “secure” properties and can be passed as -Dkey=value arguments on the java invocation command line.

The following properties, as well as properties beginning with either “javaws.” or “jnlp.”, are considered “secure” and will be passed to the VM in this way:

While “insecure” properties stopped working, we realized that “secure” properties would still be set correctly.
Maybe the mechanism that sets properties after the VM is started but before the application is invoked, got broken with this Java update, or maybe this was an intentional but undocumented change.

The work-around now depends on the type of system properties:

For system properties that affect Java behavior or libraries, we changed our code to call System.setProperty() at the application start instead of setting them in the JNLP.

For properties that we use to configure the application from the JNLP file, we added the jnlp. prefix so that they are passed correctly again.

<property name="myconfig" value="DE" />

to

<property name="jnlp.myconfig" value="DE" />

Edit: According to OpenJDK Bug JDK-8023821, the change was intentional:

Starting from 7u45 launch descriptor (JNLP file) need to be signed in order to set insecure system properties. So it is expected behaviour in 7u45…
(from a comment)

Instructions for signing a JNLP.

Leave a Comment