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

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

XMLWordPrintable

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

      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.

            herrick Andy Herrick (Inactive)
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: