unix - x windows/X11 问题

发布于 2024-11-24 20:32:57 字数 341 浏览 6 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沩ん囻菔务 2024-12-01 20:32:57

我假设您正在从自己的计算机连接到某个运行 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 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

没企图 2024-12-01 20:32:57

转到您的 unix 终端并执行以下操作:

export DISPLAY=<ip_addr>:0

例如,我会执行 export DISPLAY=10.18.192.89:0。
IP 地址是您想要查看 GUI 的机器的 IP 地址,并且该机器应该运行 Xterm 客户端。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文