JMeter工具引用外部jar文件参考20210725

JMeter’s Classpath

https://jmeter.apache.org/usermanual/get-started.html#classpath

JMeter automatically finds classes from jars in the following directories:

JMETER_HOME/lib
used for utility jars
JMETER_HOME/lib/ext
used for JMeter components and plugins

If you have developed new JMeter components, then you should jar them and copy the jar into JMeter’s lib/ext directory. JMeter will automatically find JMeter components in any jars found here. Do not use lib/ext for utility jars or dependency jars used by the plugins; it is only intended for JMeter components and plugins.

If you don’t want to put JMeter plugin jars in the lib/ext directory, then define the property search_paths in jmeter.properties.

Utility and dependency jars (libraries etc) can be placed in the lib directory.

If you don’t want to put such jars in the lib directory, then define the property user.classpath or plugin_dependency_paths in jmeter.properties. See below for an explanation of the differences.

Other jars (such as JDBC, JMS implementations and any other support libraries needed by the JMeter code) should be placed in the lib directory - not the lib/ext directory, or added to user.classpath.

JMeter will only find .jar files, not .zip.
You can also install utility Jar files in $JAVA_HOME/jre/lib/ext, or you can set the property user.classpath in jmeter.properties

Note that setting the CLASSPATH environment variable will have no effect. This is because JMeter is started with “java -jar”, and the java command silently ignores the CLASSPATH variable, and the -classpath/-cp options when -jar is used.

This occurs with all Java programs, not just JMeter.

中文版:
如果您开发了新的 JMeter 组件,那么您应该对它们进行 jar 包并将 jar 复制到 JMeter 的lib/ext目录中。JMeter 将自动在此处找到的任何 jar 中查找 JMeter 组件。不要将lib/ext用于插件使用的实用程序 jar 或依赖 jar;它仅适用于 JMeter 组件和插件。

如果您不想将 JMeter 插件 jar 放在lib/ext目录中,则在jmeter.properties 中定义属性search_paths。

实用程序和依赖项 jar(库等)可以放在lib目录中。

如果您不想将此类 jar 放在lib目录中,则 在jmeter.properties 中定义属性user.classpath或plugin_dependency_paths。有关差异的解释,请参见下文。

其他 jars(例如 JDBC、JMS 实现和 JMeter 代码所需的任何其他支持库)应该放在lib目录中 - 而不是lib/ext目录,或者添加到user.classpath。

JMeter 只会找到.jar文件,而不是.zip。
您还可以在$JAVA_HOME/jre/lib/ext 中安装实用程序 Jar 文件,或者您可以在jmeter.properties中设置属性user.classpath

请注意,设置CLASSPATH环境变量将不起作用。这是因为 JMeter 以“ java -jar ”启动,并且 java 命令 在使用-jar 时会默默地忽略CLASSPATH变量和-classpath / -cp选项。

所有 Java 程序都会发生这种情况,而不仅仅是 JMeter。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值