-
Bug
-
Resolution: Fixed
-
P3
-
17.0.10-oracle, 21.0.2, 22, 23
-
b10
-
x86_64
-
windows_10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8326841 | 22.0.1 | Alexey Semenyuk | P3 | Resolved | Fixed | b07 |
JDK-8325573 | 21.0.4-oracle | Alexey Semenyuk | P3 | Resolved | Fixed | b01 |
JDK-8329880 | 21.0.4 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
JDK-8325581 | 17.0.12-oracle | Alexey Semenyuk | P3 | Resolved | Fixed | b01 |
JDK-8333143 | 17.0.12 | Martin Doerr | P3 | Resolved | Fixed | b05 |
Windows 11,
openjdk version "21.0.2" 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Hi there,
my Java app experienced a very weird regression when switching from JDK
OpenJDK21U-jdk_x64_windows_hotspot_21.0.1_12
to
OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13
This small snippet should start a third party software (in this case Notepad++.exe but it's just an example) and after 30 seconds, close the java app that launched it.
public static void main(String... args) throws IOException {
String[] cmdToRunUsingArgs = {"cmd.exe", "/C", "C:\\Program Files\\Notepad++\\notepad++.exe"};
Runtime.getRuntime().exec(cmdToRunUsingArgs);
Executors.newSingleThreadScheduledExecutor().schedule(() -> {
System.exit(0);
}, 30, TimeUnit.SECONDS);
}
It works well with all previous JDK versions but it stopped working from java 21.0.2 and later.
With java 21.0.1, the program launches the third party app correcly, after 30 seconds, it kills itself by leaving the third app running.
With java 21.0.2, the program launches the third party app correcly, after 30 seconds, it kills itself AND the third party app.
This makes even impossible to restart a java app from the app itself.
REGRESSION : Last worked in version 17.0.10
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code snippet from a JAR file not in an IDE!
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should run a third party software and then close itself leaving the third party software running.
ACTUAL -
The program kills both the third party software and itself.
---------- BEGIN SOURCE ----------
public static void main(String... args) throws IOException {
String[] cmdToRunUsingArgs = {"cmd.exe", "/C", "C:\\Program Files\\Notepad++\\notepad++.exe"};
Runtime.getRuntime().exec(cmdToRunUsingArgs);
Executors.newSingleThreadScheduledExecutor().schedule(() -> {
System.exit(0);
}, 30, TimeUnit.SECONDS);
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround found
FREQUENCY : always
- backported by
-
JDK-8325573 System.exit(0) kills the launched 3rd party application
- Resolved
-
JDK-8325581 System.exit(0) kills the launched 3rd party application
- Resolved
-
JDK-8326841 System.exit(0) kills the launched 3rd party application
- Resolved
-
JDK-8329880 System.exit(0) kills the launched 3rd party application
- Resolved
-
JDK-8333143 System.exit(0) kills the launched 3rd party application
- Resolved
- duplicates
-
JDK-8327060 Child process started by JPackage exe exits when parent process exits
- Closed
-
JDK-8333411 Executable produced using JPackage cannot invoke another executable
- Closed
- relates to
-
JDK-8301247 JPackage app-image exe launches multiple exe's in JDK 17+
- Resolved
-
JDK-8325525 Create jtreg test case for JDK-8325203
- Resolved
-
JDK-8325924 Restarted jpackage apps will be killed when the starting jpackage app exits.
- Resolved
-
JDK-8333411 Executable produced using JPackage cannot invoke another executable
- Closed
- links to
-
Commit openjdk/jdk17u-dev/c9d83d39
-
Commit openjdk/jdk21u-dev/b9ca2532
-
Commit openjdk/jdk22u/92e57381
-
Commit openjdk/jdk/6944537c
-
Review openjdk/jdk17u-dev/2505
-
Review openjdk/jdk22u/49
-
Review(master) openjdk/jdk21u-dev/459
-
Review(master) openjdk/jdk/17779