java display 999_Java无法使用'localhost:10.0'作为DISPLAY变量的值连接到X11窗口服务器...

我有一个脚本使用Java连接到本地主机的端口10.0中显示X11

但是我总是得到这个错误

java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.

at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:62)

at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:178)

at java.security.AccessController.doPrivileged(Native Method)

at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:142)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:186)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)

at sun.awt.X11.XToolkit.(XToolkit.java:112)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:186)

at java.awt.Toolkit$2.run(Toolkit.java:849)

at java.security.AccessController.doPrivileged(Native Method)

at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)

at ij.io.Opener.openJpegOrGif(Opener.java:367)

at ij.io.Opener.openImage(Opener.java:220)

at ij.io.Opener.openImage(Opener.java:249)

at ij.io.Opener.open(Opener.java:116)

at ij.IJ.open(IJ.java:1112)

at ij.macro.Functions.open(Functions.java:2006)

at ij.macro.Functions.doFunction(Functions.java:129)

at ij.macro.Interpreter.doStatement(Interpreter.java:205)

at ij.macro.Interpreter.doBlock(Interpreter.java:515)

at ij.macro.Interpreter.runUserFunction(Interpreter.java:278)

at ij.macro.Interpreter.getFactor(Interpreter.java:1200)

at ij.macro.Interpreter.getTerm(Interpreter.java:1162)

at ij.macro.Interpreter.getExpression(Interpreter.java:1145)

at ij.macro.Interpreter.getBooleanExpression(Interpreter.java:881)

at ij.macro.Interpreter.getLogicalExpression(Interpreter.java:857)

at ij.macro.Interpreter.getBoolean(Interpreter.java:850)

at ij.macro.Interpreter.doIf(Interpreter.java:829)

at ij.macro.Interpreter.doStatement(Interpreter.java:217)

at ij.macro.Interpreter.doBlock(Interpreter.java:515)

at ij.macro.Interpreter.doStatement(Interpreter.java:241)

at ij.macro.Interpreter.doIf(Interpreter.java:831)

at ij.macro.Interpreter.doStatement(Interpreter.java:217)

at ij.macro.Interpreter.doStatements(Interpreter.java:195)

at ij.macro.Interpreter.run(Interpreter.java:99)

at ij.macro.Interpreter.run(Interpreter.java:65)

at ij.macro.Interpreter.run(Interpreter.java:75)

at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:127)

at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:112)

at ij.IJ.runMacroFile(IJ.java:103)

at ij.ImageJ.main(ImageJ.java:517)

我已经尽力解决这个问题,例如:

export DISPLAY=:10.0

export DISPLAY=localhost:10.0

我也尝试了端口0.0,但总是得到相同的错误

尝试xhost之后

xhost +local:all

xhost: unable to open display ""

xhost: unable to open display ":10.0"

我该如何解决这个问题,我认为X Server没有运行,所以我尝试了startx它说在该端口运行

我的系统是Ubuntu服务器版本10.04

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值