10
votes

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.

15
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.6botchniaque
Check jmeter.log in the same directory and copy error messages to provide more informationyousafsajjad
I just came across the same issue. The current JMeter download does not include the lib folder and seems to be a faulty build.bikeman868
chmod -R 777 ./ will helpAbhishek Puri

15 Answers

9
votes

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.
4
votes

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?

1
votes

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

0
votes

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 
0
votes

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.

0
votes

Download latest version of jmeter and run the jar file .

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

0
votes

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

0
votes
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" "$@"
0
votes

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

0
votes

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.
0
votes

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.
0
votes

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.

-1
votes

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.

-3
votes

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

-5
votes

try this

sudo chmod -R 777 /opt/