第一步:安装jprofiler window版,
第二步: 运行 jprofiler ,在菜单中选择 Session->Integration Wizard->New Remote Integration
后面几步就是傻瓜操作,jprofiler如果是监控tomcat,应该选择要监控的tomcat的startup.bat,如:
D:/java/tomcat6/bin/debug-store.bat
第三步:配环境变量path:F:/Program Files/jprofiler6/bin/windows
第四步:添加启动项
-agentlib:jprofilerti=port=8849,nowait,id=103,config=C:/Documents and Settings/Administrator/.jprofiler6/config.xml"
"-Xbootclasspath/a:F:/Program Files/jprofiler6/bin/agent.jar" -Xbootclasspath/a:F:/Program Files/jprofiler6/bin/agent.jar
第五步:配置bat文件
set CATALINA_HOME=D:/java/tomcat6
rem The following lines have been added by the
rem application server integration wizard of JProfiler
set CATALINA_OPTS=-agentpath:F:/usr/jprofilerti.dll=port=8849 %CATALINA_OPTS%
rem end of modifications
set CATALINA_BASE=D:/java/tomcat6/tomcat_store
set CATALINA_TMPDIR=D:/java/tomcat6/temp
set JAVA_HOME=d:/java/jdk/jdk1.6.0_10
set JPDA_ADDRESS=1498
set JPDA_TRANSPORT=dt_socket
set JAVA_OPTS=%JAVA_OPTS% -agentlib:jprofilerti=port=8849,nowait,config=F:/usr/config.xml -Xbootclasspath/a:F:/usr/agent.jar
catalina jpda run
注意:F:/usr/jprofilerti.dll F:/usr/config.xml F:/usr/agent.jar中间不能有空格,可以拷贝到一个文件下,再来配置
第六步:启动tomcat,在等待监听的时候启动jprofiler的session