unix - x windows/X11 问题
我有一个 java GUI jar 文件,需要在我的 unix 终端上启动。我的系统管理员说“X 已通过 ssh 启用”。但是当我输入 xterm 时,它说
xterm Xt error: Can't open display: xterm: DISPLAY is not set
我做了一些阅读,并且说我必须使用登录 $ssh -X mylogin@xyz
所以我的问题是: 1) 接下来我应该做什么...我再次输入 xterm 但窗口没有启动 2)假设我让它以某种方式工作。我如何启动我的 java GUI。 (我只需输入 jar 文件名)?
谢谢大家的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您正在从自己的计算机连接到某个运行 SSH 的服务器。首先,如果您还没有安装 X11 服务器,则需要在您自己的计算机上安装 X11 服务器。这里的术语很令人困惑 - 如果您通过 SSH 连接到另一台计算机,您可能习惯于将自己的计算机视为客户端,将远程计算机视为服务器。但在 X11 中,这些角色颠倒了。
然后,您需要在自己的计算机上启动 X11,并在其中启动
xterm
。 然后从 xterm 中,您可以运行ssh -X myserver.example.com
并在登录到该远程服务器后运行java -jar myapplication.jar
代码> 它应该可以工作。在您自己的计算机上启动 X Server 的具体机制因操作系统而异。在 Linux/FreeBSD/etc 上,您可能已经在运行一个。在 Mac 上,如果您安装了开发人员工具,则可以在“应用程序”下使用 X11。在 Windows 上,您需要类似 Xming 的东西
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.com
and once logged into that remote server, runjava -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
转到您的 unix 终端并执行以下操作:
例如,我会执行 export DISPLAY=10.18.192.89:0。
IP 地址是您想要查看 GUI 的机器的 IP 地址,并且该机器应该运行 Xterm 客户端。
Go to your unix terminal and do:
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.