先发个demo : (未完)
java 调试() 和 监控 ()
mkdir $JAVA_HOME/jconsole_pwd
cp $JAVA_HOME/jre/lib/management/jmxremote.password.template /cygdrive/c/Java/jdk1.7.0/jconsole_pwd/jmxremote.password
chmod 600 $JAVA_HOME/jconsole_pwd/jmxremote.password
vim $JAVA_HOME/jconsole_pwd/jmxremote.password
去掉#monitorRole RED前的注释并将
# 没启动,挂起监听 (推荐)
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=1011,server=y \
-Dcom.sun.management.jmxremote.port=1010 \
-Dcom.sun.management.jmxremote.password.file=c:/Java/jdk1.7.0/jconsole_pwd/jmxremote.password \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
SelectorServer
# 没启动
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=1011,server=y,suspend=n \
-Dcom.sun.management.jmxremote.port=1010 \
-Dcom.sun.management.jmxremote.password.file=c:/Java/jdk1.7.0/jconsole_pwd/jmxremote.password \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
SelectorServer
# 调试客户端
jdb -sourcepath . -connect com.sun.jdi.SocketAttach:port=1011,hostname=127.0.0.1
-- 在方法中设置断点
stop in SelectorServer.main
-- 在行中设置断点
stop at SelectorServer:157
阅读(1614) | 评论(0) | 转发(0) |