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.
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 runssh -X myserver.example.comand once logged into that remote server, runjava -jar myapplication.jarand 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