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

CDS error when module is located in a directory with space in the name

XMLWordPrintable

    • b18

        To reproduce:

        # Create a directory with a space in the name and cd to it:
        $ mkdir 'a space'
        $ cd 'a space'

        # Compile this source file:
        $ cat mypackage/MyClass.java
        package mypackage;

        public class MyClass {
            public static void main(String[] args) {
                System.out.println(args.length);
            }
        }

        $ javac mypackage/MyClass.java -d out

        # Build a jar file my.jar:
        $ jar cvf my.jar -C out .

        # Run it as a module:
        $ java --module-path my.jar -Xshare:dump -XX:SharedArchiveFile=cds.jsa --module my/mypackage.MyClass
        os::stat error 2 (ENOENT). CDS dump aborted (path was "/tmp/a%20space/my.jar").

        When running without the --module argument, there is no error and the archive gets created successfully:
        $ java --module-path my.jar -Xshare:dump -XX:SharedArchiveFile=cds.jsa mypackage.MyClass
        $ ls -la cds.jsa
        -r--r--r-- 1 maxim maxim 14061568 Sep 3 11:44 cds.jsa

              mkartashev Maxim Kartashev
              mkartashev Maxim Kartashev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: