Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling JVM options with Java Web Start / JNLP

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?

like image 390
mikera Avatar asked Feb 04 '23 03:02

mikera


1 Answers

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"/>
like image 193
3 revs Avatar answered Feb 05 '23 16:02

3 revs