“无 X11 显示变量"

编程入门 行业动态 更新时间:2024-10-19 17:35:10
本文介绍了“无 X11 显示变量"- 这是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试在我的 Linux 机器 (Slackware) 上安装 Java 应用程序.

I am trying to install a Java application on my Linux machine (Slackware).

我收到以下错误,我不明白.

I have received the following error, and I do not understand it.

你能告诉我如何解决这个问题吗?谢谢.

Could you advise me how to approach the problem? Thank you.

这是我得到的:(我看到需要设置一些 X11 DISPLAY 变量,但我应该给它什么值以及如何设置?)

Here is what I get: (I see that some X11 DISPLAY variable needs to be set, but what value should I give it and how?)

~$ java -jar gate-5.0-beta1-build3048-installer.jar - ERROR - java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless(Graphic sEnvironment.java:159) at java.awt.Window.<init>(Window.java:407) at java.awt.Frame.<init>(Frame.java:402) at net.sourceforge.mlf.metouia.borders.MetouiaDotsBuf fer.<init>(MetouiaDotsBuffer.java:105) at net.sourceforge.mlf.metouia.borders.MetouiaDots.<i nit>(MetouiaDots.java:66) at net.sourceforge.mlf.metouia.borders.MetouiaToolBar Border.<init>(MetouiaToolBarBorder.java:49) at net.sourceforge.mlf.metouia.MetouiaLookAndFeel.ini tComponentDefaults(MetouiaLookAndFeel.java:241) at javax.swing.plaf.basic.BasicLookAndFeel.getDefault s(BasicLookAndFeel.java:130) at javax.swing.plaf.metal.MetalLookAndFeel.getDefault s(MetalLookAndFeel.java:1591) at javax.swing.UIManager.setLookAndFeel(UIManager.jav a:537) at javax.swing.UIManager.setLookAndFeel(UIManager.jav a:581) at com.izforge.izpack.installer.GUIInstaller.loadLook AndFeel(GUIInstaller.java:373) at com.izforge.izpack.installer.GUIInstaller.<init>(G UIInstaller.java:116) at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Construc tor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:30 at com.izforge.izpack.installer.Installer.main(Instal ler.java:62)

推荐答案

如果您在主显示屏上,则

If you're on the main display, then

export DISPLAY=:0.0

或者如果您使用的是 csh 或 tcsh

or if you're using csh or tcsh

setenv DISPLAY :0.0

在运行您的应用之前.

实际上,我很惊讶它没有自动设置.您是否尝试从非图形终端启动此应用程序?如果没有,您是否修改了默认的 .profile、.login、.bashrc 或 .cshrc?

Actually, I'm surprised it isn't set automatically. Are you trying to start this application from a non-graphic terminal? If not, have you modified the default .profile, .login, .bashrc or .cshrc?

请注意,将 DISPLAY 设置为 :0.0 预先假定您坐在主显示器上,正如我所说,或者至少主显示器已登录到您的用户 ID.如果它没有登录,或者它是一个不同的用户 ID,这将失败.

Note that setting the DISPLAY to :0.0 pre-supposes that you're sitting at the main display, as I said, or at least that the main display is logged on to your user id. If it's not logged on, or it's a different userid, this will fail.

如果您从另一台机器进来,并且您在该机器的主显示器上并且它正在运行 X,那么您可以使用ssh -X 主机名"连接到该主机,ssh 将转发X 显示返回.ssh 还将确保正确设置 DISPLAY 环境变量(前提是它没有被我上面提到的各种点文件弄乱).在ssh -X"会话中,DISPLAY 环境变量将具有类似localhost:11.0"的值,该值将指向 ssh 正在通过隧道传输到您的本地设备的套接字.

If you're coming in from another machine, and you're at the main display of that machine and it's running X, then you can use "ssh -X hostname" to connect to that host, and ssh will forward the X display back. ssh will also make sure that the DISPLAY environment variable is set correctly (providing it isn't being messed with in the various dot files I mentioned above). In a "ssh -X" session, the DISPLAY environment variable will have a value like "localhost:11.0", which will point to the socket that ssh is tunnelling to your local box.

更多推荐

“无 X11 显示变量"

本文发布于:2023-11-28 16:40:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643166.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!