Reputation: 1117
When i am starting jmeter than it showing the follwing error An error occurred: null
My process to start jmeter is
root@L411:/opt/apache-jmeter-2.12/bin# sh jmeter An error occurred: null
Upvotes: 10
Views: 6769
Reputation: 3493
Make sure you check the jmeter.log file to understand the cause for the null
exception.
If your log shows the stack trace
java.awt.HeadlessException: null
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208)
This could be because of 2 reasons:
Your shell's config file/dotfile (.bashrc
, .bashprofile
,.zshrc
, etc.) is setting an env variable JAVA_TOOL_OPTIONS
and has the argument -Djava.awt.headless=true
. (I had to set this to prevent the surefire plugin from stealing focus every time tests are executed)
Or you have a headless JDK installed which does not support GUI apps. Install a full JDK and add it to PATH
Upvotes: 1
Reputation: 463
I was getting this error on macOS High Sierra while running jMeter.
java.lang.NullPointerException
at java.awt.Window.init
For me the problem was JVM not being able to identify a compatible graphics mode from the OS. To solve the problem I had to reset PRAM and NVRAM.
I followed this question and this answer.
Upvotes: 1
Reputation: 295
What OS are you using? I was getting the same error in Fedora 27 and I fixed it by installing the OpenJDK runtime environment (java-1.8.0-openjdk)
sudo dnf install java-1.8.0-openjdk
Upvotes: 6
Reputation: 123
If after executing jmeter.sh your apache-jmeter-x.xx/bin/jmeter.log contains something like
Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
you probably have default-jdk-headless
installed.
Installing default package (sudo yum install java-1.8.0-openjdk
) fixed the issue for me.
Upvotes: 5
Reputation: 71
This happened to me as well. In my case, I was running Jmeter 2.13 on OpenJDK 1.8 on my 64-bit Linux machine. I fixed it by installing Oracle's Java instead, and switching to it with:
alternatives --config java
I'm a bit annoyed that I have to do this now, as it used to work before (I think).
Upvotes: 7