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

jpackage is not always reporting an error when no main class specified

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: internal
    • Fix Version/s: internal
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Recently added jdk.jpackage.tests.MainClassTest test runs jpackage with various combinations of main class set on jpackage command line and in jar file. The test source - http://cr.openjdk.java.net/~asemenyuk/8232279/webrev.00/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MainClassTest.java.html

      There are two combinations that result in jpackage successfully building app image though it is supposed to fail.
      The combinations are as follows:
      1. modular app; main class NOT set on jpackage command line, only module name is specified; main class in NOT set in app's jar file; external runtime image specified on jpackage command line with --runtime-image option.
      2. modular app; main class NOT set on jpackage command line, only module name is specified; there is main class in app's jar file, however it is set to non-existing class; there is NO --runtime-image option on jpackage command line.

      To reproduce failures of these two test scenarios remove lines containing `--jpt-exclude=` substring from jtreg test description in MainClassTest.java.

      The interesting thing about failure n1 is that jpackage fails to create app image if --runtime-image option is not set on jpackage command line. This is expected as there is no main class set neither on jpackage command line, nor in app's jar file.
      However with --runtime-image option jpackage doesn't fail.

        Attachments

          Activity

            People

            Assignee:
            herrick Andy Herrick
            Reporter:
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: