• 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

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 1
3,890 points

Related questions

0 votes
1 answer 2 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 4 days ago Sheeza 4k points
0 votes
1 answer 43 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 Raphael Pacheco 4.9k points
0 votes
1 answer 2K 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 2 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 5 days ago Sheeza 4k points
0 votes
1 answer 2 views
Problem I am trying to build some application using PHP. I cannot here explain what exactly the application should to do because of NDA. Here is some identical task. Suppose we have page which asks user to provide the first name and the last name. The goal is to send to server a ... type="text" placeholder="Last Name" name="lastName" id="lastName" /> <input type="submit"/> </form> </body> </html>
asked 2 days ago alexh 1.8k points