Search code examples
javajnlpjava-web-start

What are the advantages of specifying 'package' properties in JNLP?


I have notice that you can specify <package /> properties in JNLP like described here: http://lopica.sourceforge.net/ref.html#package

What are the advantages of explicitelly defining them over letting the applet classloader do the job?


Solution

  • The JSR-56 spec explains the reasons:

    http://jcp.org/aboutJava/communityprocess/mrel/jsr056/index5.html

    4.5 Package Element

    ...

    The package element only makes sense to use with lazily-downloaded resources, since all other resources will already be available to the JVM. Thus, it will already know what packages are implemented in those JAR files. However, it can direct the JNLP Client to download the right lazy JAR resources, instead of having to download each individual resource one at a time to check.