Java can't get you the process ID (it's only valid while that other process is running anyways, and can change between runs). What you're getting back is the application exit code. There could be any...