问题描述
我需要将 java.net.preferIPv4Stack=true 设置为通过 JNLP(javaws 和小程序)启动的应用程序
I need to set java.net.preferIPv4Stack=true to an app started via JNLP (javaws and applet)
尝试了这些,但没有运气...
Tried those, without luck...
<j2se ...java-vm-args="-Djava.net.preferIPv4Stack=true" />
<property name="java.net.preferIPv4Stack" value="true"/>
System.setProperty("java.net.preferIPv4Stack", "true");
我可以让它工作的唯一方法是在从本地文件系统启动 javaws 时看到:
The only way i could make it work was seeting when launching javaws from local filesystem:
javaws -J-Djava.net.preferIPv4Stack=true myapp.jnlp
小程序或 URL 无法实现的功能.
What is not possible on a applet or URL.
我应该如何设置这个属性?
How should i set this property?
推荐答案
在 Java 7 Update 6 (b17) 中,安全属性列表已更新.有关更多详细信息,请参阅错误报告 716069.
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:
这篇关于如何为 JNLP 应用程序设置 preferredIPv4Stack 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!