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

"error: illegal argument for --class-path: Illegal char <:> at index 2: /D:/a/b"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 11.0.2
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 / jdk-11.0.2

      A DESCRIPTION OF THE PROBLEM :
      We know that to solve long classpath problem when using "java" command, we can use a classpath jar which contains all jar/directory in MANIFEST.MF, and the pattern looks like this in windows: "/D:/a/b.jar" or "/D:/a/c/".
      But now we have a case that we have to use this classpath jar When using "javac @D:/tmp.txt" to compile, then we can get this error: "error: illegal argument for --class-path: Illegal char <:> at index 2: /D:/a/b.jar"
      That means "java" and "javac @<filename>" got inconsistent behaviors when using classpath jar.
      I wonder if you would consider this as a bug or not? if yes, then how to fix this? to make javac support "/C:/a/b.jar" or just let "java -cp classpath.jar" support "C:/a/b.jar"?

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. prepare a java source file A.java which using commons lang3 api.
      2. prepare a classpath.jar which contains MANIFEST.MF file:
           Manifest-Version: 1.0
           Class-Path: /C:/test2/commons-lang3-3.8.1.jar
      3. prepare a tmp.txt file which contains"-cp C:/test2/commons-lang3-3.8.1.jar"
      4. run like "javac @C:/tmp.txt A.java".


      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fmatte Fairoz Matte
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: