Have a look on the demo hello world program in JNI, you can find it over net, and instead of printing the Hello world message just return the process id, which can be found from the linux API.
please find the article http://www.pacifier.com/~mmead/jni/cs510ajp/index.html Thanks & Regards Anirban Talukdar On Wed, Dec 2, 2009 at 12:17 PM, raj kumar <bprajkumar...@gmail.com> wrote: > Thanks alot anirban for your help. No i want to get the java process id > from > linux only. Can you help me with some script to get the same? > > THanks, > Phani. > > On Wed, Dec 2, 2009 at 12:14 PM, Anirban Talukdar < > talukdar.anir...@gmail.com> wrote: > > > In java i don find any API that returns the id of the process. Hopefully, > > It > > is because process ID is not standard for all the operating system. I am > > not > > sure about this. > > > > But in linux you can write a simple C/C++ function to get the process id. > > And that later can be integrated with java through JNI. > > > > If you found direct API in Java, please inform. > > > > Thanks & Regards > > Anirban Talukdar > > > > On Wed, Dec 2, 2009 at 12:00 PM, raj kumar <bprajkumar...@gmail.com> > > wrote: > > > > > Hi friends, > > > > > > When i ran tomcat and shut it down my java process is not closing along > > > with > > > shutdown.i need to kill it explicitly. So I would like to know how to > > > identify the java process of the logged in user who started the server. > > so > > > that i can kill the process id from the shutdown.sh script itself. > Please > > > help me. > > > > > > Tomcat: jakarta-tomcat-5.0.28 > > > Java : j2sdk1.4.2 > > > OS: SunOS > > > > > > Thanks, > > > Phani. > > > > > >