Executable source program should ignore module declaration

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 27
    • Component/s: tools
    • None
    • Fix Understood

      The Java source launcher executing a single source file that with a shebang line should ignore any module-info.java file present in the program's root directory. As per JEP 458:

          Step 1:
          If the file begins with a "shebang" line, that is, a line that starts with #!,
          then the source path passed to the compiler is empty so that no other
          source files will be compiled. Proceed to step 4.

      An error message can read like this:

          module-info.java:4: error: file should be on source path, or on patch path for module
          module helper {
          ^
          1 error
          error: compilation failed

      In such cases, no error should be raised and the program be run on the classpath.

            Assignee:
            Christian Stein
            Reporter:
            Christian Stein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: