diff --git a/test/jdk/tools/jpackage/share/AppContentTest.java b/test/jdk/tools/jpackage/share/AppContentTest.java index ef34c375fc3c0..15b6176356223 100644 --- a/test/jdk/tools/jpackage/share/AppContentTest.java +++ b/test/jdk/tools/jpackage/share/AppContentTest.java @@ -162,13 +162,16 @@ private static Path copyAppContentPath(Path appContentPath) throws IOException { private static Path createAppContentLink(Path appContentPath) throws IOException { var appContentArg = TKit.createTempDirectory("app-content"); + Path dstPath; if (copyInResources) { - appContentArg = appContentArg.resolve(RESOURCES_DIR).resolve(LINKS_DIR); - } else { + appContentArg = appContentArg.resolve(RESOURCES_DIR); + dstPath = appContentArg.resolve(LINKS_DIR) + .resolve(appContentPath.getFileName()); + } else { appContentArg = appContentArg.resolve(LINKS_DIR); + dstPath = appContentArg.resolve(appContentPath.getFileName()); } - var dstPath = appContentArg.resolve(appContentPath.getFileName()); Files.createDirectories(dstPath.getParent()); // Create target file for a link