ADDITIONAL SYSTEM INFORMATION :
A DESCRIPTION OF THE PROBLEM :
In JDK 8, using the Process class to execute the command "/Applications/LibreOffice.app/Contents/MacOS/soffice --help"works as expected. However, after switching to JDK 21, the thread executing the command becomes unresponsive, and the forked process causes CPU usage to spike to 100%.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. install soffice
2. run code
3. switch jdk
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
return immediately
ACTUAL -
no result
---------- BEGIN SOURCE ----------
ProcessBuilder processBuilder = new ProcessBuilder(
"/Applications/LibreOffice.app/Contents/MacOS/soffice",
"--help"
);
Process process = processBuilder.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
int exitCode = process.waitFor();
System.out.println("Process exited with code: " + exitCode);
---------- END SOURCE ----------