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

Improve javac command line parsing and error reporting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • 10
    • tools
    • None
    • b09
    • x86
    • windows_10

      The issue is that on Windows from the command prompt with Java 10, if you do:

          javac *.java

      in a directory where "*.java" matches nothing, you get a horrible, horrible error message. So bad, it scares people away from Java. IMHO this is bad enough to be considered a bug, and a P3 bug under the old JavaSoft system, at that!

      Here's the inexcusably awful error message:

      C:\Users\nickt\Documents\java_projects\lab-01-ntteng\part1>javac foooo*.java
      Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <*> at index 5: foooo*.java
              at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
              at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
              at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
             at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
              at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
              at java.base/java.nio.file.Paths.get(Paths.java:84)
              at jdk.compiler/com.sun.tools.javac.main.Option$37.process(Option.java:700)
              at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Option.java:1103)
              at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:381)
              at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:347)
              at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:193)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:224)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
              at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
              at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)

      Reported by: Bill Foote - wffoote@calpoly.edu

            sdama Srinivas Dama (Inactive)
            mlagally Michael Lagally
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: