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

Confusing error message when reading bad module declaration

    Details

    • Subcomponent:
    • Resolved In Build:
      b156
    • Verification:
      Verified

      Backports

        Description

        From Stephen Colebourne:

        When trying to compile a module-info.java file, "weak" is rejected (I
        assume not implemented yet). But, this is a report about the error
        handling, which fails to recognise that this is a module-info file,
        and thus outputs messages about missing class/interface/enum. Some
        additional processing is needed to work out that the user was trying
        to declare a module and got the syntax wrong:

        > \apps\jdk-9-ea\bin\javac --module-source-path src -d mods src\myapp\
        org\myapp\MyApp.java src\mylib\org\mylib\MyLib.java src\myapp\module-info.java s
        rc\mylib\module-info.java

        src\myapp\module-info.java:1: error: class, interface, or enum expected
        weak module myapp {
        ^
        src\myapp\module-info.java:3: error: class, interface, or enum expected
        }
        ^
        2 errors

        Stephen

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sadayapalam Srikanth Adayapalam
                  Reporter:
                  jjg Jonathan Gibbons
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: