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
# 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
- links to
-
Commit(master) openjdk/jdk/aceae76f
-
Review(master) openjdk/jdk/20987