JMeter Installation
Asked Answered
G

16

10

How can I solve this error when running 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)

JMeter home directory was detected as: /opt/apache-jmeter-2.6.

Gunstock answered 12/2, 2013 at 8:4 Comment(4)
probably user starting jmeter has no permissions to /opt/apache-jmeter-2.6 directory. Try running as root, but better option is to add needed permissions sudo chmod -R u+w /opt/apache-jmeter-2.6Harriott
Check jmeter.log in the same directory and copy error messages to provide more informationTo
I just came across the same issue. The current JMeter download does not include the lib folder and seems to be a faulty build.Protoxide
chmod -R 777 ./ will helpElin
P
9

Your JMeter installation may be broken.
You can possibly try the following:

  1. try to use a fresh installation of last available JMeter version instead of your current - if using 2.6 is no requirement in your case;
  2. check the integrity of downloaded JMeter archive against PGP or MD5 signatures;
  3. class org.apache.jmeter.JMeter should be in the file JMETER_HOME/lib/ext/ApacheJMeter_core.jar. Check if this is there or not. Check that jar is not broken;
  4. check that $JAVA_HOME is defined and points to actual JDK.
Pursley answered 12/2, 2013 at 10:46 Comment(3)
Hi I already tried the jmeter 2.9, I used the installer which I download. apache-jmeter-2.9.zip, apache-jmeter-2.9_src.tgz, apache-jmeter-2.9_src.zip but I still encounter same problem. Here's what I did I extracted the file on /opt/ then make it executable the apache-jmeter-2.9 by issuing this command chmod 770 -R apache-jmeter-2.9 then copy the ApacheJMeter.jar inside apache-jmeter-2.9/bin and run ./jmeter.sh but I still get or encounter same error. Please kindly let me know the proper procedure or steps on installing the apachejmeter.Gunstock
1. jmeter.sh is very basic JMeter script with no JVM options specified; try also jmeter script instead (./jmeter or sh jmeter); 2. have you checked your JDK installation and version? 3. then copy the ApacheJMeter.jar inside apache-jmeter-2.9/bin - no need to copy ApacheJMeter.jar into /bin dir, it's already there in out-of-box installation.Pursley
I had same issue and resolve it by downloading it from different mirror.Parson
D
4

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.

Can you please let us know the OS version you are trying to install?

Detonator answered 10/7, 2015 at 23:49 Comment(0)
R
1

ClassNotFoundException has 2 possible meanings:

  1. You don't have a jar with the class defined
  2. You have duplicate definitions of that class.

Maybe you are stuck with some jar in a folder common to all your java programs? e.g your path, or libraries/java/extensions

Rhetoric answered 5/5, 2015 at 17:30 Comment(0)
S
0

Looks like your JMeter installation is not successful.

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.

jar -tf <JMETER_HOME>/lib/ext/ApacheJMeter_core.jar 
Sycophancy answered 12/2, 2013 at 11:1 Comment(2)
I got the following error when I run the command you give to me. How can solve or fix that error? [root@bx1 bin]# jar -tf /opt/apache-jmeter-2.6/lib/ext/ApacheJMeter_core.jar java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:131) at java.util.zip.ZipFile.<init>(ZipFile.java:92) at sun.tools.jar.Main.list(Main.java:997) at sun.tools.jar.Main.run(Main.java:242) at sun.tools.jar.Main.main(Main.java:1167) You have new mail in /var/spool/mail/root [root@bx1 bin]#Gunstock
The error shows that your jar might be corrupted. The installation is strait forward and you need not copy any jars in to bin directory. Verify your downloaded file for correctness.Sycophancy
A
0

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.

You should try that if everything else fail.

You will have to appropriately set JAVA_HOME and PATH, which has newer java in it.

Alcott answered 16/8, 2013 at 3:35 Comment(0)
S
0

Download latest version of jmeter and run the jar file .

check the below link http://www.thetestingworld.com/category/docs/jmeter/

Screens answered 4/5, 2015 at 10:47 Comment(1)
Please note that link-only answers are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference.Wield
P
0

Please use the latest version of jmeter as it has all the fixes which you could be looking for

Ppm answered 11/5, 2015 at 17:4 Comment(0)
I
0
JAVA_HOME=path JAVA_HOME

and modify this line in script jmeter

java $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"

for this

$JAVA_HOME/bin/java $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"
Invert answered 5/10, 2015 at 14:39 Comment(0)
C
0

Check your JDK version. It should always be the latest for jmeter.

Cunningham answered 30/8, 2017 at 19:28 Comment(0)
F
0

Below are possbile issues

  1. Either Java Path not set properly
  2. Your installation of JMeter is not proper
  3. Trying to run JMeter from a Invalid directory structure where the necessary lib files are not found
  4. Finally your Java version compatibility.

Quick fix:

  1. Check your Java Installation from cmd promt with java -version which should be 1.7 or greater
  2. If above step works download and unzip/untar JMeter into a new directory and try again.
Flirtation answered 9/11, 2017 at 18:27 Comment(0)
P
0

ClassNotFoundException occurs if:

  1. the jar containing the class definition is not present.

  2. there exists some duplicate definition of a class.

The error:

java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
means that the jar file is missing/corrupted, due to which you're getting this error message.

You can try these methods:

  • Check if this class is present in /lib/ext/ApacheJMeter_core.jar
  • Check if this jar file is not broken.
  • try to use fresh installation of last available jmeter version
  • check integrity of downloaded jmeter archive against PGP or MD5 signatures
  • check that $JAVA_HOME is defined and points to JDK 1.6.0 or higher.
Panache answered 9/11, 2018 at 7:11 Comment(0)
I
0

JMeter Plugin Manager Installation -

For this download the jar file from [THIS LINK][1] and put inside lib/ext and restart JMeter. You will be able to view JMeter Plugin Manager icon as per below screenshot.

Indubitability answered 3/5, 2020 at 14:52 Comment(0)
M
0

just put your JMeter folder to other directories (like C:\JMeter) rather than system directories like program files, bin, win32....

Motta answered 17/5, 2023 at 3:15 Comment(0)
T
-1

The only thing needed to run Jmeter is JDK and JRE(which JDK/JRE sersion to be installed depends on the Jmeter version you are installing), which should be installed on your system. And the JRE path should be set in Environment variables. This should be enough to run Jmeter. Also once check the compatibility of JDK/JRE version with Jmeter version u r installing.

Twit answered 11/6, 2018 at 14:33 Comment(0)
G
-3

it seem permision error, try this command line,

sudo chmod -R 777 /opt/

make sure you have install oracle jdk,check this,

java -version

java version "1.8.0_45"

Java(TM) SE Runtime Environment (build1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

check java_home

echo $JAVA_HOME

/usr/lib/jvm/java-8-oracle/jre

Gerhardine answered 23/7, 2015 at 8:41 Comment(0)
G
-5

try this

sudo chmod -R 777 /opt/

Geis answered 24/7, 2015 at 9:37 Comment(3)
Is this a joke? No, please NO, DO NOT TRY THIS! chmod -R 777 is usually a bad practice, depending on what follows (/mydir/uploads/ might be acceptable for example). Here this is a directory at root level used to install software, you should never do that.Forwards
/opt/ is the system folder and this message java.lang.Throwable: Could not access /opt/apache-jmeter-2.6/lib/ext, you should have root or permission to acess that folderGeis
To that very specific directory, yes, but not a 777 on /opt/!!Forwards

© 2022 - 2024 — McMap. All rights reserved.