Skip to content

Instantly share code, notes, and snippets.

@saltnlight5
Created October 29, 2012 15:35
Show Gist options
  • Save saltnlight5/3974220 to your computer and use it in GitHub Desktop.
Save saltnlight5/3974220 to your computer and use it in GitHub Desktop.
killjava.sh
# Terminate all java processes forcefully!
# This script is for Cygwin only.
# WARN: Be very sure what's what you want. You usually want this if they are stuck and
# not responsive.
LIST=$(jps -l | grep -v 'sun.tools.jps.Jps')
echo $LIST
for PID in $(echo $LIST | ruby -a -ne 'puts $F[0]'); do
echo "Killing Java PID $PID"
/usr/bin/kill -f $PID
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment