--- old/modules/jdk.packager/src/main/java/jdk/packager/builders/linux/LinuxAppImageBuilder.java 2017-07-17 10:18:45.000000000 -0700 +++ new/modules/jdk.packager/src/main/java/jdk/packager/builders/linux/LinuxAppImageBuilder.java 2017-07-17 10:18:45.000000000 -0700 @@ -26,6 +26,7 @@ import com.oracle.tools.packager.BundlerParamInfo; +import com.oracle.tools.packager.IOUtils; import com.oracle.tools.packager.Log; import com.oracle.tools.packager.RelativeFileSet; import com.oracle.tools.packager.StandardBundlerParam; @@ -68,6 +69,7 @@ private final Path root; private final Path appDir; private final Path runtimeDir; + private final Path resourcesDir; private final Path mdir; private final Map params; @@ -95,11 +97,13 @@ this.root = imageOutDir.resolve(APP_NAME.fetchFrom(config)); this.appDir = root.resolve("app"); this.runtimeDir = root.resolve("runtime"); + this.resourcesDir = root.resolve("resources"); this.mdir = runtimeDir.resolve("lib"); this.params = new HashMap(); config.entrySet().stream().forEach(e -> params.put(e.getKey().toString(), e.getValue())); Files.createDirectories(appDir); Files.createDirectories(runtimeDir); + Files.createDirectories(resourcesDir); } private Path destFile(String dir, String filename) { @@ -184,7 +188,7 @@ copyApplication(); // Copy icon to Resources folder -//FIXME copyIcon(resourcesDirectory); + copyIcon(); } catch (IOException ex) { Log.info("Exception: " + ex); @@ -204,6 +208,12 @@ writeCfgFile(p, root.resolve(getLauncherCfgName(p)).toFile(), "$APPDIR/runtime"); } + private void copyIcon() throws IOException { + File icon = ICON_PNG.fetchFrom(params); + File iconTarget = new File(resourcesDir.toFile(), APP_FS_NAME.fetchFrom(params) + ".png"); + IOUtils.copyFile(icon, iconTarget); + } + private void copyApplication() throws IOException { List appResourcesList = APP_RESOURCES_LIST.fetchFrom(params); if (appResourcesList == null) {