$JAVA_HOME/bin/jps
command lists all java processes, but its output always includes itself, since jps
is also a java program. So you will always get at least one entry:C:\> C:\jdk5\bin\jps -lI don't think I ever care about jps process itself. So I always run my wrapper script to filter out
1856 sun.tools.jps.Jps
sun.tools.jps.Jps
:C:\bin> more jps.batIn Linux, I simply define a bash alias in
@echo off
echo -------------------
C:\jdk5\bin\jps -l | grep -v sun.tools.jps.Jps
$HOME/.bashrc
:alias jps='$JAVA_HOME/bin/jps | grep -v sun.tools.jps.Jps'Or a tcsh alias in
.tcshrc
or .cshrc
:alias jps '$JAVA_HOME/bin/jps | grep -v'
Tags: