使用Java Web Start/JNLP启用JVM选项 [英] Enabling JVM options with Java Web Start / JNLP

查看:77
本文介绍了使用Java Web Start/JNLP启用JVM选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个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所述,Java 6 u10允许JNLP中包含多个j2se元素. JNLP文件语法<最新的 Java Web Start开发人员指南的/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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆