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

Class path does not accept malformed file path

    Details

      Description

      JDK 9 doesn't recognize a slash leading file URI as a valid classpath in Windows.

      Testcase & Reproduction Instructions
      ------------------------------------
      %JDK9%\bin\javac C:\hello\Hello.java
      %JDK9%\bin\jar cvf C:\hello.jar C:¥hello

      %JDK9%\bin\java -cp C:\hello.jar Hello
      Hello

      %JDK9%\bin\java -cp C:/ hello.jar Hello
      Hello

      %JDK9%\bin\java -cp /C:/ hello.jar Hello
      Error: Could not find or load main class hello.Hello
      Caused by: java.lang.ClassNotFoundException: hello.Hello

      %JDK8%\bin\java -cp /C:/ hello.jar Hello
      Hello

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shadowbug Shadow Bug
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: