Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8095932

[Packager] Unable to start application when user JVM options are provided

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8u40
    • 8u40
    • deploy
    • Windows 7

      To reproduce:

      Create any bundle using the following properties:

      Map<String, String> userJvmOptions = new HashMap<String, String>();
      userJvmOptions.put("-Xmx", "1024m");
      userJvmOptions .put("-Xms", "1024m");
      params.put(USER_JVM_OPTIONS.getID(), userJvmOptions);

      The bundled application won't start.

      E.g. on Windows using EXE bundler I got the following values in the .cfg file:

      jvmuserarg.1.name=-Xmx
      jvmuserarg.1.value=1024m
      jvmuserarg.2.name=-Xms
      jvmuserarg.2.value=1024m

      When I run the app I got:

      Error occurred during initialization of VM
      Initial heap size set to a larger value than the maximum heap size.


      If I don't specify the Xmx value then the following code
      {{
        RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
        List<String> aList = bean.getInputArguments();

        for (String prop : aList) {
          System.out.println(prop);
        }
      }}

      returns:
      -Xmx100m

            shemnon Danno Ferrin (Inactive)
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: