Running soffice process in java hangs only in MacOS

Trying to make simple document converter with Java by executing a soffice process.
But suddenly simple code like this hangs and does not prints anything.

ProcessBuilder pb = new ProcessBuilder(List.of("/opt/homebrew/bin/soffice", "--help"));
Process p = pb.directory(new File(sdir)).inheritIO().start();
System.out.println("errcode : " + p.waitFor()); //The process never ends!

Executing other commands(like “echo hello”) works, running “/opt/homebrew/bin/soffice --help” directly in shell works, running this code in Windows also works.
Also, since this code worked a few months ago, so I suspect it might be a problem of newer version.

My environment is openjdk 17.0.13 and LibreOffice 24.8.2.1 (0f794b6e29741098670a3b95d60478a65d05ef13) in MacOS Sonoma 14.6.1.
Is there anyone having same issue?

from an IDE or directly ?

what does ps say ?

Both have same result(endless hang)

zsh % ps  xao pid,ppid,stat,comm | grep eclipse
98281     1 S    /Applications/Eclipse.app/Contents/MacOS/eclipse
zsh % ps  xao pid,ppid,stat,comm | grep 38708  
38708 98281 S    /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java
38709 38708 S    /bin/sh
zsh % ps  xao pid,ppid,stat,comm | grep soffice
38710 38709 R    /Applications/LibreOffice.app/Contents/MacOS/soffice

It seems the process is considered running, as a child of /bin/sh(who’s child of java from eclipse).

Interestingly, modifying command to List.of("zsh", "-c", "/opt/homebrew/bin/soffice", "--help") does not change output of ps. It still says that soffice process is child of /bin/sh

add ,cputime,args

yep, it’s a wrapper : How do I edit "soffice script" on Mac OS X? - #2 by oweng

zsh % ps  xao pid,ppid,stat,cputime,args,comm | grep -e soffice
39343 39342 S      0:00.00 /bin/sh /opt/homebrew/bin/soffice --help                         /bin/sh
39344 39343 R      1:23.51 /Applications/LibreOffice.app/Contents/MacOS/soffice --help      /Applications/LibreOffice.app/Contents/MacOS/soffice

huh ? :wink:

depending how deep you wanna dive into the fun :

I don’t get it. Is that mean something more than just the soffice process has been running for 1 and a half minutes?

Tried them all but sadly there was no difference.
Will try to downgrade the libreoffice through homebrew, and I’ll try attatching GDB if that doesn’t work.

Edit : Tried 24.2.7 (libreoffice-still — Homebrew Formulae) but no good.