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

Arguments from jpackager cfg file not processed correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • internal
    • internal
    • tools

      The jpackager cfg file originally was a properties file, but was transitioned to have sections in them:
      [APPLICATION]
      [JavaOptions]
      [ArgOptions]
      The content of the first section are still properties, all of the form key=value.
      But all the entries seem to be treated as properties.

      as a result when you run the following:
      $JDK_HOME/bin/jpackage create-app-image \
      --output output \
      --name mod \
      --module 'me.mymodule/me.mymodule.Main' \
      --module-path 'input-mods/mods;input/other-mods' \
      --java-options --add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED \
      --java-options --add-exports=java.base/sun.security.util=other.mod.bar,ALL-UNNAMED \
      you get the correct config file:
      ----------------------------
      [Application]
      app.name=mod
      app.version=1.0
      app.runtime=$APPDIR\runtime
      app.identifier=me.mymodule
      app.classpath=
      app.mainmodule=me.mymodule/me.mymodule.Main

      [JavaOptions]
      --add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
      --add-exports=java.base/sun.security.util=other.mod.bar,ALL-UNNAMED

      [ArgOptions]
      ------------------------------
      but when you run it the arguments passed to vm are:
      --add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
      --add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
      because the IniFile.cpp splits these into key, value pairs, and since the keys are the same, only one value can exist, so even though It passes two args, they are the same.

      This seems to happen to any vm args that contain equals sign and are the same preceeding the equals sign.



            almatvee Alexander Matveev
            herrick Andy Herrick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: