Created
October 29, 2012 15:35
-
-
Save saltnlight5/3974220 to your computer and use it in GitHub Desktop.
killjava.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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