我想在我们的项目中使用jamm。为了使用它,我必须将'-javaagent:< .. path ...> /jamm-0.2.5.jar'作为JVM args传递。
我可以通过将jar添加到tomcat / lib文件夹并修改startup.bat来在tomcat中传递此参数,如下所示:
set JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -javaagent:"%CATALINA_HOME%\lib\jamm-0.2.5.jar"
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
但是我无法在Jetty9中实现同样的目标。正如在Tomcat中所做的那样,我已经将jamm-0.2.5.jar复制到jetty-distribution-9.2.3.v20140905 / lib并在startup.ini中添加了以下内容
--exec
-Xms1024m
-Xmx1024m
-XX:MaxPermSize=256m
-Xdebug
-Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n
-javaagent:E:\jetty-distribution-9.2.3.v20140905\lib\jamm-0.2.5.jar
它不起作用。我也尝试删除它并将其添加到jetty.sh
#####################################################
# Add jetty properties to Java VM options.
#####################################################
JAVA_OPTIONS+=("-Djetty.home=$JETTY_HOME" "-Djetty.base=$JETTY_BASE" "-Djava.io.tmpdir=$TMPDIR" "-javaagent:$JETTY_HOME/lib/jamm-0.2.5.jar")
但它没有用。我应该在哪里通过这些jvm args在码头?我不能像在Tomcat中使用TOMCAT_HOME那样引用JETTY_HOME吗?
注意:我正在使用Windows 8.这是java -jar start.jar的输出--list-config:
Java Environment:
-----------------
java.home = C:\Program Files\Java\jre7
java.vm.vendor = Oracle Corporation
java.vm.version = 23.0-b21
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.info = mixed mode
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.7.0_04-b22
java.io.tmpdir = C:\Users\PGULLA~1\AppData\Local\Temp\
user.dir = E:\jetty-distribution-9.2.3.v20140905
user.language = en
user.country = US
Jetty Environment:
-----------------
jetty.version = 9.2.3.v20140905
jetty.home = E:\jetty-distribution-9.2.3.v20140905
jetty.base = E:\jetty-distribution-9.2.3.v20140905
Config Search Order:
--------------------
<command-line>
${jetty.base} -> E:\jetty-distribution-9.2.3.v20140905
${jetty.home} -> E:\jetty-distribution-9.2.3.v20140905
JVM Arguments:
--------------
-Xms1024m
-Xmx1024m
-XX:MaxPermSize=256m
-Xdebug
-Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n
-javaagent:E:\jetty-distribution-9.2.3.v20140905\lib\jamm-0.2.5.jar
System Properties:
------------------
(no system properties specified)
Properties:
-----------
http.timeout = 30000
jetty.dump.start = false
jetty.dump.stop = false
jetty.output.buffer.size = 32768
jetty.port = 8081
jetty.request.header.size = 8192
jetty.response.header.size = 8192
jetty.send.date.header = false
jetty.send.server.version = true
jsp-impl = apache
threads.max = 200
threads.min = 10
threads.timeout = 60000
Jetty Server Classpath:
-----------------------
Version Information on 35 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0:0.2.5 | ${jetty.base}\lib\ext\jamm-0.2.5.jar
1:9.2.3.v20140905 | ${jetty.base}\lib\apache-jsp\org.eclipse.jetty.apache-jsp-9.2.3.v20140905.jar
2: 3.8.2.v20130121-145325 | ${jetty.base}\lib\apache-jsp\org.eclipse.jetty.orbit.org.eclipse.jdt.core-3.8.2.v20130121.jar
3:8.0.9 | ${jetty.base}\lib\apache-jsp\org.mortbay.jasper.apache-el-8.0.9.M3.jar
4: 2.3 | ${jetty.base}\lib\apache-jsp\org.mortbay.jasper.apache-jsp-8.0.9.M3.jar
5:1.2.1 | ${jetty.base}\lib\apache-jstl\org.apache.taglibs.taglibs-standard-impl-1.2.1.jar
6:1.2.1 | ${jetty.base}\lib\apache-jstl\org.apache.taglibs.taglibs-standard-spec-1.2.1.jar
7:(dir) | ${jetty.base}\resources
8:3.1.0 | ${jetty.base}\lib\servlet-api-3.1.jar
9: 3.1.0.M0 | ${jetty.base}\lib\jetty-schemas-3.1.jar
10:9.2.3.v20140905 | ${jetty.base}\lib\jetty-http-9.2.3.v20140905.jar
11:9.2.3.v20140905 | ${jetty.base}\lib\jetty-server-9.2.3.v20140905.jar
12:9.2.3.v20140905 | ${jetty.base}\lib\jetty-xml-9.2.3.v20140905.jar
13:9.2.3.v20140905 | ${jetty.base}\lib\jetty-util-9.2.3.v20140905.jar
14:9.2.3.v20140905 | ${jetty.base}\lib\jetty-io-9.2.3.v20140905.jar
15:9.2.3.v20140905 | ${jetty.base}\lib\jetty-jndi-9.2.3.v20140905.jar
16: 1.4.1.v201005082020 | ${jetty.base}\lib\jndi\javax.mail.glassfish-1.4.1.v201005082020.jar
17: 1.2 | ${jetty.base}\lib\jndi\javax.transaction-api-1.2.jar
18:9.2.3.v20140905 | ${jetty.base}\lib\jetty-security-9.2.3.v20140905.jar
19:9.2.3.v20140905 | ${jetty.base}\lib\jetty-servlet-9.2.3.v20140905.jar
20:9.2.3.v20140905 | ${jetty.base}\lib\jetty-webapp-9.2.3.v20140905.jar
21:9.2.3.v20140905 | ${jetty.base}\lib\jetty-deploy-9.2.3.v20140905.jar
22:9.2.3.v20140905 | ${jetty.base}\lib\jetty-plus-9.2.3.v20140905.jar
23:9.2.3.v20140905 | ${jetty.base}\lib\jetty-annotations-9.2.3.v20140905.jar
24:5.0.1 | ${jetty.base}\lib\annotations\asm-5.0.1.jar
25:5.0.1 | ${jetty.base}\lib\annotations\asm-commons-5.0.1.jar
26: 1.2 | ${jetty.base}\lib\annotations\javax.annotation-api-1.2.jar
27: 1.0 | ${jetty.base}\lib\websocket\javax.websocket-api-1.0.jar
28:9.2.3.v20140905 | ${jetty.base}\lib\websocket\javax-websocket-client-impl-9.2.3.v20140905.jar
29:9.2.3.v20140905 | ${jetty.base}\lib\websocket\javax-websocket-server-impl-9.2.3.v20140905.jar
30:9.2.3.v20140905 | ${jetty.base}\lib\websocket\websocket-api-9.2.3.v20140905.jar
31:9.2.3.v20140905 | ${jetty.base}\lib\websocket\websocket-client-9.2.3.v20140905.jar
32:9.2.3.v20140905 | ${jetty.base}\lib\websocket\websocket-common-9.2.3.v20140905.jar
33:9.2.3.v20140905 | ${jetty.base}\lib\websocket\websocket-server-9.2.3.v20140905.jar
34:9.2.3.v20140905 | ${jetty.base}\lib\websocket\websocket-servlet-9.2.3.v20140905.jar
Jetty Active XMLs:
------------------
${jetty.base}\etc\jetty.xml
${jetty.base}\etc\jetty-http.xml
${jetty.base}\etc\jetty-deploy.xml
${jetty.base}\etc\jetty-plus.xml
${jetty.base}\etc\jetty-annotations.xml