@@ -53,6 +53,7 @@ public class ApplicationInstance {
5353
5454 private static final String DEPLOYMENT_SYSPROP = "deployment.javaws" ;
5555 private static final String DEPLOYMENT_SYSPROP_VALUE = "IcedTea-Web" ;
56+ public static final String IGNORE_JNLP_RESOURCE_PROPERTIES = "ignoreJnlpResourceProperties" ;
5657
5758 // todo: should attempt to unload the environment variables
5859 // installed by the application.
@@ -134,6 +135,17 @@ public void finalize() {
134135 * Install the environment variables.
135136 */
136137 private void installEnvironment () {
138+ setSystemPropertiesFromJnlp ();
139+
140+ // The "deployment.javaws" flag is always set to "IcedTea-Web" to make it possible
141+ // for the started application to detect the execution context.
142+ System .setProperty (DEPLOYMENT_SYSPROP , DEPLOYMENT_SYSPROP_VALUE );
143+ }
144+
145+ private void setSystemPropertiesFromJnlp () {
146+ if ("true" .equalsIgnoreCase (System .getenv (IGNORE_JNLP_RESOURCE_PROPERTIES ))) {
147+ return ;
148+ }
137149 final List <PropertyDesc > props = collectPropertiesFromJnlpHierarchy (new ArrayList <>(), file );
138150
139151 if (!(props .size () == 0 )) {
@@ -146,19 +158,15 @@ private void installEnvironment() {
146158
147159 final PrivilegedAction <Object > setPropertiesAction = () -> {
148160 for (PropertyDesc propDesc : props ) {
149- LOG .debug ("Setting Property {}" , propDesc .getKey ());
161+ LOG .debug ("Setting System Property {} with value {} " , propDesc .getKey (), propDesc . getValue ());
150162 System .setProperty (propDesc .getKey (), propDesc .getValue ());
151163 }
152164 return null ;
153165 };
154166
155- LOG .info ("about to set system properties" );
167+ LOG .info ("About to set system properties" );
156168 AccessController .doPrivileged (setPropertiesAction , acc );
157169 }
158-
159- // The "deployment.javaws" flag is always set to "IcedTea-Web" to make it possible
160- // for the started application to detect the execution context.
161- System .setProperty (DEPLOYMENT_SYSPROP , DEPLOYMENT_SYSPROP_VALUE );
162170 }
163171
164172 /**
@@ -305,5 +313,4 @@ private List<PropertyDesc> collectPropertiesFromJnlpHierarchy(List<PropertyDesc>
305313 }
306314 return props ;
307315 }
308-
309316}
0 commit comments