RnD
RnD

Reputation: 1182

unix - x windows/X11 question

I have a java GUI jar file that i need to launch at my unix terminal. My system admin says "X is already enabled via ssh". But when i type xterm it says

xterm Xt error: Can't open display: xterm:  DISPLAY is not set

I did some reading and it says i have to login using $ssh -X mylogin@xyz

So my question is: 1) What should i do next...i typed xterm again but the window does not launch 2) Suppose i get it working somehow. How can i launch my java GUI. (do i simply type the jar file name)?

Thank you all for your help.

Upvotes: 1

Views: 2688

Answers (2)

Dan
Dan

Reputation: 11069

I am assuming you are connecting from your own computer to some server running SSH. First off, you need to install an X11 server on your own machine if you don't have one already. The terminology here is confusing - if you're connecting to another machine by SSH, you're probably used to thinking of your own machine as the client and the remote one as the server. But in the case of X11, those roles are reversed.

Then, you'll need to start X11 on your own machine and within that, launch an xterm. Then from that xterm, you can run ssh -X myserver.example.com and once logged into that remote server, run java -jar myapplication.jar and it ought to work.

The specific mechanism for launching an X Server on your own machine varies by operating system. On Linux/FreeBSD/etc, you're probably running one already. On a Mac, X11 is available under Applications if you've installed the developer tools. On Windows you'll need something like Xming

Upvotes: 1

Suraj Chandran
Suraj Chandran

Reputation: 24791

Go to your unix terminal and do:

export DISPLAY=<ip_addr>:0

For e.g. I would do export DISPLAY=10.18.192.89:0. The ip-address is of the machine where you want to see the GUI and that machine should have an Xterm client running.

Upvotes: 0

Related Questions