JDK-8224854 : "error: illegal argument for --class-path: Illegal char <:> at index 2: /D:/a/b"
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 11.0.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-05-27
  • Updated: 2019-05-28
  • Resolved: 2019-05-28
Related Reports
Duplicate :  
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



Comments
This is known issue, closing as duplicate of JDK-8218268
28-05-2019