-
Bug
-
Resolution: Fixed
-
P4
-
19, 21
-
b18
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8361199 | 21.0.9 | Timofei Pushkin | P4 | Resolved | Fixed | master |
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
- backported by
-
JDK-8361199 CDS error when module is located in a directory with space in the name
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk21u-dev/ee0c1167
-
Commit(master) openjdk/jdk/aceae76f
-
Review(master) openjdk/jdk21u-dev/1833
-
Review(master) openjdk/jdk/20987