Enabling JVM options with Java Web Start / JNLP
Asked Answered
K

1

9

I'm creating a Web Start application which would benefit from some of the newer JVM options (especially escape analysis, G1 garbage collector etc.)

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?

Khamsin answered 16/8, 2010 at 15:41 Comment(2)
Have you read the JNLP spec as revised for Java 6u10?Elysia
Just had a look - thanks for pointer. It is not exactly clear on this point but it looks like multiple resources elements with different java-vm-args for each JVM version might work?Khamsin
E
12

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"/>
Elka answered 16/8, 2010 at 15:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.