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

ClassLoaderExt::process_jar_manifest() should allow / separator on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • hotspot
    • b16

      On Windows, you can use / as the file separator in the classpath. For example, both of the following are allowed:

          java -cp foo\bar.jar FooMain
          java -cp foo/bar.jar FooMain

      However, ClassLoaderExt::process_jar_manifest only recognizes the backslash character as file separator

      https://github.com/openjdk/jdk/blob/55851a312baaea5af14c04fb1b436313fe0deac7/src/hotspot/share/classfile/classLoaderExt.cpp#L213

      Therefore, if bar.jar has the following in its META-INF/MANIFEST.MF

         Class-Path: lib.jar

      When running with the following

          java -cp foo/bar.jar -Xlog:clss+path=trace FooMain

      The following warning is printed:

      [0.042s][info][class,path] library (non-existent) = lib.jar

      As a result, all classes loaded from lib.jar cannot be archived (with a message of "Unsupported location")

            ccheung Calvin Cheung
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: