changeset 17730:30aba497f34e

8165697: jlink running on Mac with Windows jmods produces non-runnable image Reviewed-by: jlaskey, redestad
author sundar
date Thu, 08 Sep 2016 20:21:42 +0530
parents 0ac0a3b43f0a
children 32540f1a8a70
files src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java	Wed Sep 07 14:59:55 2016 -0700
+++ b/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>