The conventional unix kill
command is difficult to use against Java
applications. JKill, for unix only, wraps kill
to make it easier to
use against Java applications.
There is no need for a JKill equivalent on win32: the Task Manager can be used instead.
JKill is inherently unsafe. Not only does it cut the application off at the
knees (possibly resulting in data loss), but it doesn't always target the
correct application, and if the VM is really hosed for whatever reason, JKill
doesn't always work. Further, JKill is only a pre-processor which attempts
to identify the correct process to kill
- we are concerned that it
may provide a false sense of security by seeming to do something more
sophisticated.
Given these difficulties, we recommend that, in situations where the
normal methods for shutting down an application have failed, you should use
kill(1)
. Please consult your linux system administration guide
(in whatever form it takes) for more information.
When an application goes rogue or hangs, it must be killed manually. However,
when using Java on unix, there is usually a mad proliferation of processes, all
called "java". There are typically several processes for each java app you have
running (this is due to the mechanisms used to support threading). In this
situation, killall
and killproc
are insufficiently
selective, and wading through the swathes of ps aux
output to find
the right process is tiresome.
JKill addresses this issue by identifying the set of java processes which are running, and determining the main Java class in use in each case. It then kills the process which is running the class you specify.
If you have more than one instance of the same app open, one of them will be killed at random.
Linux/x86 (libc6, gcc 3.3, kernel 2.4) is supported. Java 1.4 and Java 5 only. We intend to port to Solaris/SPARC and Mac OS X when resources permit; interested hackers would be needed for ports to other platforms. It should be easy to port the Linux version to other flavours of unix.
Syntax: jkill [-help] [-version] [-9] {-f bootname | class}
-help
: Prints a usage summary (a precis of this) and then exits.
This must be the only parameter supplied.-version
: Prints the version of JKill and then exits. This
must be the only parameter supplied. -9
: send SIGKILL to the process, rather than the more gentle
SIGTERM. SIGTERM can be caught by the process and allows it to shut down
gracefully; SIGKILL cuts the process off at the knees, and may leave a
nasty mess behind. Therefore it should only be used on processes that have
previously failed to respond to SIGTERM. -f bootname
: Obtain the necessary class name from
a JStart boot-file. This is the most convenient way to proceed if the java
app was started by JStart.class
: the classname to kill. For java apps which were
not started with JStart. Supply either a class or -f bootname
,
not both.