8165697: jlink running on Mac with Windows jmods produces non-runnable image
Reviewed-by: jlaskey, redestad
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java Wed Sep 07 14:59:55 2016 -0700
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java Thu Sep 08 20:21:42 2016 +0530
@@ -189,12 +189,12 @@
storeFiles(modules, release);
if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) {
- // launchers in the bin directory need execute permission
+ // launchers in the bin directory need execute permission.
+ // On Windows, "bin" also subdirectories containing jvm.dll.
if (Files.isDirectory(bin)) {
- Files.list(bin)
- .filter(f -> !f.toString().endsWith(".diz"))
- .filter(f -> Files.isRegularFile(f))
- .forEach(this::setExecutable);
+ Files.find(bin, 2, (path, attrs) -> {
+ return attrs.isRegularFile() && !path.toString().endsWith(".diz");
+ }).forEach(this::setExecutable);
}
// jspawnhelper is in lib or lib/<arch>