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 number of things which would cause your program to terminate, though I doubt Java is one of those. Java does not allow you to access other processes.

Hopefully that helps, I'm not entirely sure what it is you're after.

April 26th, 2011, 04:06 AM

hardikjadhav

Re: Start application, and return process ID (PID)

Hi,

If some other application is running, it means there must be problem with program.exe.