How to set preferIPv4Stack property for JNLP app?

谁都会走 提交于 2019-12-06 07:40:29

With the Java 7 Update 6 (b17) the list of secure properties has been updated. See Bug Report 716069 for further Details.

You can include this setting by specifying the following line within the resource tag:

<property name="java.net.preferIPv4Stack" value="true"/>

The only properties that you can set in the JNLP are those considered secure which do not include java.net.preferIPv4Stack.

The alternative options you have are (not tested):

  • pass the parameter directly to javaws like you did: javaws -J-Djava.net.preferIPv4Stack=true myapp.jnlp
  • Java Control Panel > Java > View > Runtime Parameters, but that is a global setting for all webstart applications and applets using the version of the JRE for which you changed the setting
  • use an environment variable: JAVAWS_VM_ARGS = -Djava.net.preferIPv4Stack=true
  • flag the setting as secure by adding a line to the deployment.properties file, located in the Deployment Home(*) : deployment.javaws.secure.properties=java.net.preferIPv4Stack - note: not sure if this is available Java > 1.5.

The first 3 options are detailed in this document.

(*) Deployment Home:
Windows XP: %HOME%\Application Data\Sun\Java\Deployment
Windows 7/Vista: %APPDATA%\..\LocalLow\Sun\Java\Deployment
Linux/Solaris: %HOME%/.java/deployment

Also, for future readers - environment variable for applets:

_JPI_VM_OPTIONS

e.g.

_JPI_VM_OPTIONS=-Djava.net.preferIPv4Stack=true

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!