Simple way to find a java process (Mac/linux)

If you want "kill" a java process maybe you will like to know the process identifier (PID), so you have to do this for know the PID (Linux)
$ ps -fea|grep -i java

user  2895  8191  0 09:28 pts/1    00:00:00 grep -i java
user  4610  4607  1 Aug29 ?        01:40:00 /home/user/Software/java-7-sun/bin/java -Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx768m -XX:MaxPermSize=256m -jar /home/user/Software/springsource/sts-3.3.0.RELEASE//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar -os linux -ws gtk -arch x86_64 -showsplash -launcher /home/user/Software/springsource/sts-3.3.0.RELEASE/STS -name STS --launcher.library /home/user/Software/springsource/sts-3.3.0.RELEASE//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130521-0416/eclipse_1506.so -startup /home/user/Software/springsource/sts-3.3.0.RELEASE//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar --launcher.overrideVmargs -exitdata 518012 -product org.springsource.sts.ide -vm /home/user/Software/java-7-sun/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx768m -XX:MaxPermSize=256m -jar /home/user/Software/springsource/sts-3.3.0.RELEASE//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.ja
First column is user that run the process, second column PID
So if you want to kill java process (in this example is STS/Eclipse) you have to do this:
$ kill -9 4610 #or any signal that you need
More Article: 

Comments