• Register
0 votes

Problem :

I have installed Java application on my Linux machine and now i am receiving following error :

no x11 display variable was set, but this program performed an operation which requires it.

6 5 3
6,930 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

To resolve the issue you should enable X11 forwarding in your PuTTy

Now to do that please open PuTTy also go to Connection => SSH => Tunnels and do check mark the Enable X11 forwarding

Also do sudo to the server and export the following variable also note here IP is your local machine's IP

export DISPLAY=

enter image description here

9 7 4
38,600 points
0 votes

When you are exporting the Display to other machines, make sure you have entered the command xhost+ on that machine. This command allows the other machines to export their display on this machine. There can be many security constraints. You need to check ssh –X MachineIP is not required by xhost +?


Sometimes JCONSOLE does not allow all its processes. Since those JVM run with different users and you are trying to export the DISPLAY with another user. So it is better to follow C_DIR > sudo./jconsole.


In was ( WEBSPAHERE); jconsole was not able to connect its java server process. At that time just go to the link, and then try again to connect. It is also possible that this page is initializing some variables to enable jconsole to connect with the server.

WAS -> Console -> Application servers -> server1 -> Process definition -> Java virtual machine.

NX clients for windows:

  • Through this Windows machine, Connect to Unix box where GUI console is available.
  • Move SSH to the AIX box from the UNIX box.
  • Set the display like “export DISPLAY = UNIXMACHINE:NXClientPORTConnectedMentionedOnTitle”
  • Now when you launch any program, that requires DISPLAY, it will be launched on the UNIX box.


11 5 2
3,890 points

Related questions

0 votes
1 answer 29 views
Problem: Hi! I am a novice and trying to catch up the concepts in Java. I tried to access a local variable without assigning it a value in main() method and got following error: error: variable might not have been initialized Meanwhile, if I declare the ... variable or the same value is assigned to all variables regardless of datatype? If any of you could explain this, I would be thankful.
asked Nov 29, 2020 Code Learner 9.2k points
0 votes
1 answer 2 views
Problem: I get the following error if I login as root; if I login as admin user, then x11 starts with no problems. Ubuntu 14.04 Xming server 2.0 running on Windows 8.1 Could not display the GUI. This application needs access to an X Server.
asked Mar 31 ummesalma 22.9k points
0 votes
1 answer 27 views
Problem: I tried alot of things , nether of them work ! any explaniation !! putty x11 proxy: unable to connect to forwarded x server: network error: connection refused.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 8 views
Problem : x11 connection rejected because of wrong authentication.
asked Mar 1 Shovo210 13.2k points
0 votes
1 answer 2.9K views
Problem : I am trying to run startx via PuTTY and Xming but it gives following error: putty x11 proxy: unable to connect to forwarded x server: network error: connection refused
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 129 views
Problem: I am naïve to C# programming. I am trying to use the auto-implemented properties. I think the best ever way to fix below error is to declare my own backing variable? Please find below my C# code: public Point Origin { get; set; } ... unchanged. To resolve this error, store the result of the expression in an intermediate value, or use a reference type for the intermediate expression.
asked Jul 23, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 2 views
Problem: Please help me: x11 forwarding requested but display not set
asked 3 days ago tuhin1 47.2k points
0 votes
1 answer 64 views
Problem: Hello! I just started learning Java. I am trying to figure out the differences in naming conventions for variables and constants in Java. I declared following variables and I want to know which of these are constants? int Const = 4; float HEIGHT = 3.4; bool True = true;
asked Nov 29, 2020 Code Learner 9.2k points
0 votes
1 answer 31 views
0 votes
1 answer 3 views
Problem: I am stuck during learning as I have already mentioned in my question someone please cooperate me to continue my project-Thanks
asked Mar 23 rubelkhan 20.4k points