How to bundle JVM (JRE/JDK) in the installer bundle?


How to create JVM in the format suitable for bundling?

  1. Create temporary directory and copy there all files from the JVM you want to bundle
  2. (Optional) Pack jars using bin/pack200 utility:
    ./bin/pack200 -J-Xmx1024m lib/rt.jar.pack.gz lib/rt.jar
  • Note that you cannot pack the following list of jars:
  • jce.jar
  • local_policy.jar
  • sunjce_provider.jar
  • sunpkcs11.jar
  • US_export_policy.jar
  • sunmscapi.jar
  1. Zip the directory contents to any zip file:
  • zip -9 -r -y ../jvm.zip .
  1. Create self-extracted zip archive using tools UnZipSFX tools for particular platform:
  • copy /B unzipsfx.exe + jvm.zip jvm.exe (windows)
    cat unzipsfx.bin jvm.zip > jvm.bin (unix)
  • zip -A jvm.exe (windows)
    zip -A jvm.bin (unix)
  1. Run NBI in create bundle mode with adding the following parameter -J-Dnbi.bundled.jvm.file=<path-to-jvm.exe>

Tools for automatic bundle JVM creation

You can find all tools (scripts, unzipsfx binaries) at nbi/infra/build/jvm

Articles and Howtos

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo