Posted By

fuzzylollipop on 10/07/09


Tagged

java groovy pid


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

fuzzylollipop
laurenceosx


How to get platform independant PID using Groovy / Java 1.6


 / Published in: Java
 

  1. import java.lang.management.*
  2.  
  3. final String name = ManagementFactory.getRuntimeMXBean().getName();
  4. final Integer pid = Integer.parseInt(name[0..name.indexOf("@")-1])

Report this snippet  

You need to login to post a comment.