使用 Java Web Start/JNLP 启用 JVM 选项 [英] Enabling JVM options with Java Web Start / JNLP
问题描述
我正在创建一个 Web Start 应用程序,它将受益于一些较新的 JVM 选项(尤其是逃逸分析、G1 垃圾收集器等)
I'm creating a Web Start application which would benefit from some of the newer JVM options (especially escape analysis, G1 garbage collector etc.)
同时,我希望应用程序能够在不支持这些选项的旧 JVM 上正常运行.
At the same time, I would like the application to work gracefully on older JVMs that do not support these options.
有什么好的方法可以实现吗?
Is there a good way of achieving this?
推荐答案
正如 Thorbjørn 所提到的,Java6 u10 允许在 JNLP 中使用多个 j2se
元素.JNLP 文件语法<最新的Java Web Start Developer's Guide 的/strong> resources
部分,表示多个j2se
元素,每个元素带有java-vm-args
属性可以指定为最优先出现的.例如:
As Thorbjørn mentioned, Java 6 u10 allows multiple j2se
elements in JNLP. The JNLP File Syntax resources
section of the latest Java Web Start Developer's Guide, indicates that multiple j2se
elements, each with java-vm-args
attributes can be specified with the most preferred occurring first. For example:
<j2se version="1.3" initial-heap-size="64m" max-heap-size="128m"/>
<j2se version="1.4.2+" href="http://java.sun.com/products/autodl/j2se"
java-vm-args="-esa -Xnoclassgc"/>
这篇关于使用 Java Web Start/JNLP 启用 JVM 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!