开发者

Starting an external process fails: cannot connect to X server

开发者 https://www.devze.com 2023-01-05 13:52 出处:网络
as part of my eclipse plugin I try to start an external program by using process.exec. This works with some tools (I tested it with gedit, for example), but with the one I need it does not work: isimg

as part of my eclipse plugin I try to start an external program by using process.exec. This works with some tools (I tested it with gedit, for example), but with the one I need it does not work: isimgui: cannot connect to X server.

This is part of the XILINX webpack, none of the included graphic tools can be started like this.

开发者_开发技巧

Any ideas how I met get it to work?


You probably need to pass the -display argument to the executable you are running, or better (more widely supported) set the environment variable DISPLAY to the right value (try ':0')

use for example: process.exec(String[] cmdarray, String[] envp)

envp should contain at least one string "DISPLAY=:0"


You must inherit the DISPLAY variable from your shell (and possibly also the X11 authentication file information).

0

精彩评论

暂无评论...
验证码 换一张
取 消