When I run our program with wrapper from systemd service. The program catch the java.io.IOException: Cannot run program "netstat": error=2, No such file or directory
but when I start directly from the wrapper, it won't catch this error and work fine.
We use Runtime Excec command in java 8
String command = "netstat -tulpn | grep :" + port;
Process process = Runtime.getRuntime().exec(command);
It's really inconvenient but I had to change netstat's path to absolute then the problem seems to be solved. But on different servers, netstat is in a different path.