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

JavaFX application in named module fails to launch if no main method

    XMLWordPrintable

Details

    Description

      The attached test program launches and runs fine in the unnamed module. If it is packaged and run as a modular application, then it fails to launch.

      Steps to reproduce:

      1. Compile the attached test program as a module:

      javac --module-source-path src -d build/classes src/mymod/module-info.java src/mymod/simple/Simple.java

      2. Run the test program as a modular application:

      java --module-path build/classes -m mymod/simple.Simple

      It will fail with the following exception:

      Error: Main method not found in class simple.Simple, please define the main method as:
         public static void main(String[] args)
      or a JavaFX application class must extend javafx.application.Application

      Attachments

        Issue Links

          Activity

            People

              ddehaven David Dehaven (Inactive)
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: