2008年12月31日星期三

blogger daily 12/31/2008


Posted from Diigo. The rest of my favorite links are here.

2008年12月23日星期二

blogger daily 12/23/2008


Posted from Diigo. The rest of my favorite links are here.

2008年12月14日星期日

blogger daily 12/14/2008


Posted from Diigo. The rest of my favorite links are here.

2008年12月6日星期六

2008年12月5日星期五

2008年12月4日星期四

blogger daily 12/04/2008


Posted from Diigo. The rest of my favorite links are here.

2008年12月2日星期二

blogger daily 12/02/2008


Posted from Diigo. The rest of my favorite links are here.

2008年12月1日星期一

使用jps查看java进程ID

在Linux上经常需要查看Java的进程ID,例如想kill掉某个Java进程就需要pid。使用ps + grep可能觉得不是很方便,如果classpath很长,输出会非常难看。
其实从JDK1.5开始,Sun就提供了一个非常方便的Java进程查看工具:jps 。 配合适当的参数,输出一目了然。例如,我经常使用jps -lv,
-l
Output the full package name for the application's main class or the full path name to the application's JAR file.
-v
Output the arguments passed to the JVM.

更多的参数可以查看jdk的文档http://java.sun.com/javase/6/docs/technotes/tools/share/jps.html

JDK提供这个工具是为了和其他的Troubleshooting工具配合使用,例如jmap、jstack,这些工具也很有意思,有兴趣的可以尝试用用http://java.sun.com/javase/6/docs/technotes/tools/index.html#troubleshoot。

blogger daily 12/01/2008


Posted from Diigo. The rest of my favorite links are here.