Java exec() results in no output in linux

For some reason, executing something like ping in java generates no output, but something like uptime does.

I’m guessing the reason for this is because ping has the sticky bit set. It seems like any programs that has the sticky bit will fail to run and generate any output in java.
Edit: Actually, this doesn’t seem to be true. mount has the sticky bit set but it runs fine.
Edit: Running the java program from a shell script causes java to generate output as it normally should….
Edit: The problem solved itself… Try to remove all environment variables by running unset `env | awk -F= '/^\w/ {print $1}' | xargs` and see what happens by running

Leave a Reply

Your email address will not be published.