Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to kill a java process under Solaris?

843798Apr 25 2002 — edited Apr 30 2002
Hi, All:

I need some help here. I am not sure if this is the right place since my question is more Unix related.

I need to write a RC script for a java app. I need to provide start and stop service in my script.

For start service
start) my_app &

Then how can I kill it? Because there are other java processes on the server, I cannot use
ps -ef | grep java to determine the PID of my app.

And 'echo $$' only returns the PID of the shell that launches my app. That is $$ has the PPID of
my java process instead of PID. When I kill that PPID, my app's PPID will become 1.

So can anyone tell me how to kill a java process through PID in shell script?

Thanks

Jim
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2002
Added on Apr 25 2002
3 comments
319 views