fix: launch with the selected JVM and own subprocess lifetimes

This commit is contained in:
objz committed 2026-10-01 23:22:53 +02:00
1 parent eb436c2ab8
commit dc351df546
31 files changed
+3061 -820

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
// SPDX-FileCopyrightText: 2026 Constantin Bauer
// SPDX-License-Identifier: GPL-3.0-only
import java.nio.file.Files;
import java.nio.file.Paths;
public final class InstallerLifetimeFixture {
public static void main(String[] args) throws Exception {
boolean child = args.length != 0 && args[0].equals("child");
if (!child) {
String java = Paths.get(System.getProperty("java.home"), "bin",
System.getProperty("os.name").startsWith("Windows") ? "java.exe" : "java").toString();
new ProcessBuilder(java, "-cp", System.getProperty("java.class.path"),
"InstallerLifetimeFixture", "child").inheritIO().start();
}
String prefix = child ? "installer-child" : "installer";
Files.write(Paths.get(prefix + "-ready"), new byte[] {1});
Thread.sleep(1200);
Files.write(Paths.get(prefix + "-survived"), new byte[] {1});
}
}