java JMeter 安装
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14828027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JMeter Installation
提问by cutejakes .
How can I solve this error when running JMeter:
运行 JMeter 时如何解决此错误:
[root@bx1 bin]#./jmeter.sh
java.lang.Throwable: Could not access /opt/apache-jmeter-2.6/lib/ext at org.apache.jmeter.NewDriver.(NewDriver.java:98)
java.lang.Throwable: Could not access /opt/apache-jmeter-2.6/lib/junit at org.apache.jmeter.NewDriver.(NewDriver.java:98)
java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at org.apache.jmeter.NewDriver.main(NewDriver.java:212)
java.lang.Throwable:无法在 org.apache.jmeter.NewDriver.(NewDriver.java:98) 访问 /opt/apache-jmeter-2.6/lib/ext
java.lang.Throwable:无法在 org.apache.jmeter.NewDriver.(NewDriver.java:98) 访问 /opt/apache-jmeter-2.6/lib/junit
java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
在 java.net.URLClassLoader$1.run(URLClassLoader.java:217) 在 java.security.AccessController.doPrivileged(Native Method) 在 java.net.URLClassLoader.findClass(URLClassLoader.java:205) 在 java.lang.ClassLoader。 loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at org.apache.jmeter.NewDriver.main(NewDriver.java:212)
JMeter home directory was detected as: /opt/apache-jmeter-2.6
.
JMeter 主目录被检测为:/opt/apache-jmeter-2.6
。
回答by Aliaksandr Belik
Your JMeter installation may be broken.
You can possibly try the following:
您的 JMeter 安装可能已损坏。
您可能可以尝试以下操作:
- try to use a fresh installation of last available JMeter versioninstead of your current - if using 2.6 is no requirement in your case;
- check the integrity of downloaded JMeter archive against PGP or MD5 signatures;
- class
org.apache.jmeter.JMeter
should be in the fileJMETER_HOME/lib/ext/ApacheJMeter_core.jar
. Check if this is there or not. Check that jar is not broken; - check that
$JAVA_HOME
is defined and points to actual JDK.
- 尝试使用最新安装的最新可用 JMeter 版本而不是当前版本- 如果在您的情况下不需要使用 2.6;
- 根据PGP 或 MD5 签名检查下载的 JMeter 存档的完整性;
- 类
org.apache.jmeter.JMeter
应该在文件中JMETER_HOME/lib/ext/ApacheJMeter_core.jar
。检查这是否存在。检查罐子没有破损; - 检查
$JAVA_HOME
已定义并指向实际 JDK。
回答by user3285525
There is basically no installation of the Jmeter, you don't execute or the set up file to install it. When you download the zip/gzip from the Apache site unzip, navigate to the bin
folder and click on the ApacheJmeter.Jar
. This will launch the Jmeter UI instance. Also make sure you the Java JDK and JRE installed in your system.
基本上没有安装Jmeter,你不执行或安装文件来安装它。当您从 Apache 站点解压缩下载 zip/gzipbin
文件时,导航到该文件夹并单击ApacheJmeter.Jar
. 这将启动 Jmeter UI 实例。还要确保您的系统中安装了 Java JDK 和 JRE。
Can you please let us know the OS version you are trying to install?
您能告诉我们您尝试安装的操作系统版本吗?
回答by Dan
ClassNotFoundException has 2 possible meanings:
ClassNotFoundException 有两种可能的含义:
- You don't have a jar with the class defined
- You have duplicatedefinitions of that class.
- 你没有定义类的 jar
- 您对该类有重复的定义。
Maybe you are stuck with some jar in a folder common to all your java programs? e.g your path, or libraries/java/extensions
也许您在所有 Java 程序共有的文件夹中都被某个 jar 卡住了?例如您的路径,或库/java/扩展
回答by Rams
Please use the latest version of jmeter as it has all the fixes which you could be looking for
请使用最新版本的 jmeter,因为它具有您可能正在寻找的所有修复程序
回答by Ramadas
Looks like your JMeter installation is not successful.
看起来您的 JMeter 安装不成功。
java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
The class org.apache.jmeter.JMeter should be in the jar file <JMETER_HOME>/lib/ext/ApacheJMeter_core.jar
. Run the below jar command to check if the file exists in the jar.
类 org.apache.jmeter.JMeter 应该在 jar 文件中<JMETER_HOME>/lib/ext/ApacheJMeter_core.jar
。运行以下 jar 命令以检查该文件是否存在于 jar 中。
jar -tf <JMETER_HOME>/lib/ext/ApacheJMeter_core.jar
回答by Manish Sapariya
This may sound wierd, but I have seen many java program raise such random errors, when run with openjdk which ships by default with CentOS. In such cases, I could run same programs with SUN/Oracle JDK.
这听起来可能很奇怪,但我已经看到许多 Java 程序在使用 CentOS 默认附带的 openjdk 运行时会引发此类随机错误。在这种情况下,我可以使用 SUN/Oracle JDK 运行相同的程序。
You should try that if everything else fail.
如果其他一切都失败了,您应该尝试一下。
You will have to appropriately set JAVA_HOME and PATH, which has newer java in it.
您必须适当地设置 JAVA_HOME 和 PATH,其中包含较新的 java。
回答by Tarun Gupta
Download latest version of jmeter and run the jar file .
下载最新版本的 jmeter 并运行 jar 文件。
check the below link http://www.thetestingworld.com/category/docs/jmeter/
回答by Andresnet
JAVA_HOME=path JAVA_HOME
and modify this line in script jmeter
并在脚本 jmeter 中修改这一行
java $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"
for this
为了这
$JAVA_HOME/bin/java $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"
回答by Abhinay
Check your JDK version. It should always be the latest for jmeter.
检查您的 JDK 版本。它应该始终是 jmeter 的最新版本。
回答by Shan
Below are possbile issues
以下是可能的问题
- Either Java Path not set properly
- Your installation of JMeter is not proper
- Trying to run JMeter from a Invalid directory structure where the necessary lib files are not found
- Finally your Java version compatibility.
- Java 路径设置不正确
- 您的 JMeter 安装不正确
- 尝试从无效的目录结构运行 JMeter,其中找不到必要的 lib 文件
- 最后是您的 Java 版本兼容性。
Quick fix:
快速解决:
- Check your Java Installation from cmd promt with java -version which should be 1.7 or greater
- If above step works download and unzip/untar JMeter into a new directory and try again.
- 从 cmd promt 使用 java -version 检查您的 Java 安装,该版本应为 1.7 或更高
- 如果上述步骤有效,请下载 JMeter 并将其解压缩/解压到新目录中,然后重试。