Score:0

Cant run Jmeter on Ubuntu - No X11 DISPLAY variable was set

tl flag

I get error when i run Jmeter that -

An error occurred: 
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,

But my variable is SET. display variable

2022-12-02 14:38:39,871 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN
2022-12-02 14:38:39,885 INFO o.a.j.JMeter: Loading user properties from: user.properties
2022-12-02 14:38:39,885 INFO o.a.j.JMeter: Loading system properties from: system.properties
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: Copyright (c) 1998-2022 The Apache Software Foundation
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: Version 5.5
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: java.version=19.0.1
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: java.vm.name=OpenJDK 64-Bit Server VM
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: os.name=Linux
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: os.arch=amd64
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: os.version=5.15.0-56-generic
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: file.encoding=UTF-8
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: java.awt.headless=null
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: Max memory     =1073741824
2022-12-02 14:38:39,890 INFO o.a.j.JMeter: Available Processors =8
2022-12-02 14:38:39,897 INFO o.a.j.JMeter: Default Locale=English (EN)
2022-12-02 14:38:39,897 INFO o.a.j.JMeter: JMeter  Locale=English (EN)
2022-12-02 14:38:39,897 INFO o.a.j.JMeter: JMeterHome=/home/ankur/software/jmeter/apache-jmeter-5.5
2022-12-02 14:38:39,897 INFO o.a.j.JMeter: user.dir  =/home/ankur/software/jmeter/apache-jmeter-5.5/bin
2022-12-02 14:38:39,898 INFO o.a.j.JMeter: PWD       =/home/ankur/software/jmeter/apache-jmeter-5.5/bin
2022-12-02 14:38:39,898 INFO o.a.j.JMeter: IP: 127.0.1.1 Name: ankur FullName: ankur
2022-12-02 14:38:39,904 INFO o.a.j.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties
2022-12-02 14:38:40,004 INFO o.a.j.JMeterGuiLauncher: Setting LAF to: com.github.weisj.darklaf.DarkLaf:com.github.weisj.darklaf.theme.DarculaTheme
2022-12-02 14:38:40,147 ERROR o.a.j.JMeter: An error occurred: 
java.awt.HeadlessException: 
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,

    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:166) ~[?:?]
    at java.awt.Window.<init>(Window.java:553) ~[?:?]
    at java.awt.Frame.<init>(Frame.java:428) ~[?:?]
    at java.awt.Frame.<init>(Frame.java:393) ~[?:?]
    at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1919) ~[?:?]
    at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1995) ~[?:?]
    at javax.swing.JDialog.<init>(JDialog.java:276) ~[?:?]
    at javax.swing.JDialog.<init>(JDialog.java:210) ~[?:?]
    at javax.swing.JDialog.<init>(JDialog.java:158) ~[?:?]
    at org.apache.jmeter.SplashScreen.<init>(SplashScreen.java:52) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.JMeterGuiLauncher.startGuiInternal(JMeterGuiLauncher.kt:87) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.JMeterGuiLauncher.access$startGuiInternal(JMeterGuiLauncher.kt:47) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.JMeterGuiLauncher$startGui$1$1.invokeSuspend(JMeterGuiLauncher.kt:67) ~[ApacheJMeter_core.jar:5.5]
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.21.jar:1.6.21-release-334(1.6.21)]
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.6.1.jar:?]
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) ~[?:?]
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) ~[?:?]
    at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?]
    at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?]
    at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) ~[?:?]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?]
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) ~[?:?]
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) ~[?:?]
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) ~[?:?]
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ~[?:?]

Ubuntu System Information

Nathaniel Rogers avatar
cn flag
I've got the same issue. My particular case I'm running jmeter through WSL on windows as a linux GUI, hopefully a solution works, I'll update here if I find something :)
Score:1
cn flag

This particular issue seems to be because the DISPLAY environment variable isn't set. This can be fixed with the following

export DISPLAY=:0

You can check it worked with

echo $DISPLAY
# you should see :0

Bonus answer

But if the issue you really have is more like

An error occurred: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable

The solution could be to ensure the x11 socket is available on the machine you are using.

In my case I was trying to get jmeter GUI running via a docker image. I was able to do it by ensuring the host and guest shared a read-writable volume at /tmp/.X11-unix:/tmp/.X11-unix

Score:1
kz flag

The issue is due to that you have multiple java versions.

Step1: Check version you have sudo dpkg --list | grep -i jdk . Also uninstall from software centre if you have open JDK

Step 2: Remove jdk sudo apt-get purge openjdk*

Step 3: Run in command line java -version, You will see no program is installed

Step4: Install sudo apt-get install openjdk-8-jre

JMeter should work now.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.