[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: PID of a launched JVM process

The underlying Java implementation of java.lang.Process does not expose the 
PID

Darins

"Julien Canches" <julien.canches@xxxxxxxxxx> wrote in message 
news:d81skl$32n$1@xxxxxxxxxxxxxxxxxxx
> Is there a way to get the process id of a JVM process launched using the 
> jdt.launching APIs?
>
> The JVM is launched with the following piece of code:
>
> VMRunnerConfiguration conf =
> new VMRunnerConfiguration(mainClass, classPath);
> conf.setProgramArguments(args);
> IVMRunner runner =
> JavaRuntime.getDefaultVMInstall().getVMRunner(
> launch.getLaunchMode());
> runner.run(conf, launch, monitor);
>
> Since the run method does not return a value, I monitor the "launch" 
> object to detect the creation of a process of type "java". From this 
> process instance, is there a way to get its PID? I have not found in the 
> javadoc a process attribute that could help me.
>
> Thanks,
> Julien