< prev index next >
test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java
Print this page
@@ -305,11 +305,11 @@
*/
public Path appRuntimeInstallationDirectory() {
if (PackageType.IMAGE == packageType()) {
return null;
}
- return appInstallationDirectory().resolve("runtime");
+ return appInstallationDirectory().resolve(appRuntimePath(packageType()));
}
/**
* Returns path where application launcher will be installed.
* If the command will package Java run-time only, still returns path to
@@ -386,21 +386,26 @@
}
/**
* Returns path to runtime directory relative to image directory.
*
- * Function will always return "runtime".
- *
* @throws IllegalArgumentException if command is configured for platform
* packaging
*/
public Path appRuntimeDirectoryInAppImage() {
final PackageType type = packageType();
if (PackageType.IMAGE != type) {
throw new IllegalArgumentException("Unexpected package type");
}
+ return appRuntimePath(type);
+ }
+
+ private static Path appRuntimePath(PackageType type) {
+ if (PackageType.LINUX.contains(type)) {
+ return Path.of("lib/runtime");
+ }
return Path.of("runtime");
}
public boolean isFakeRuntimeInAppImage(String msg) {
return isFakeRuntime(appImage().resolve(
@@ -412,21 +417,22 @@
}
private static boolean isFakeRuntime(Path runtimeDir, String msg) {
final List<Path> criticalRuntimeFiles;
if (Test.isWindows()) {
- criticalRuntimeFiles = List.of(Path.of("server\\jvm.dll"));
+ criticalRuntimeFiles = List.of(Path.of("bin\\server\\jvm.dll"));
} else if (Test.isLinux()) {
- criticalRuntimeFiles = List.of(Path.of("server/libjvm.so"));
+ criticalRuntimeFiles = List.of(Path.of("lib/server/libjvm.so"));
} else if (Test.isOSX()) {
- criticalRuntimeFiles = List.of(Path.of("server/libjvm.dylib"));
+ criticalRuntimeFiles = List.of(Path.of("lib/server/libjvm.dylib"));
} else {
throw new IllegalArgumentException("Unknwon platform");
}
- if (criticalRuntimeFiles.stream().filter(v -> v.toFile().exists())
- .findFirst().orElse(null) == null) {
+ if (criticalRuntimeFiles.stream().filter(
+ v -> runtimeDir.resolve(v).toFile().exists()).findFirst().orElse(
+ null) == null) {
// Fake runtime
Test.trace(String.format(
"%s because application runtime directory [%s] is incomplete",
msg, runtimeDir));
return true;
< prev index next >