“X11 DISPLAY 변수 없음”-무슨 의미입니까?
Linux 시스템 (Slackware)에 Java 애플리케이션을 설치하려고합니다.
다음과 같은 오류가 발생했는데 이해가되지 않습니다.
문제에 접근하는 방법을 알려주시겠습니까? 감사합니다.
내가 얻는 것은 다음과 같습니다. (일부 X11 DISPLAY 변수를 설정해야하지만 어떤 값을 어떻게 제공해야합니까?)
~$ 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)
메인 디스플레이에 있다면
export DISPLAY=:0.0
또는 csh 또는 tcsh를 사용하는 경우
setenv DISPLAY :0.0
앱을 실행하기 전에
사실 자동으로 설정되지 않아 놀랍습니다. 그래픽이 아닌 터미널에서이 애플리케이션을 시작하려고합니까? 그렇지 않은 경우 기본 .profile, .login, .bashrc 또는 .cshrc를 수정 했습니까?
DISPLAY를 : 0.0으로 설정하면 내가 말했듯이 메인 디스플레이에 앉아 있거나 적어도 메인 디스플레이가 사용자 ID로 로그온되어 있다고 가정합니다. 로그온하지 않았거나 다른 사용자 ID이면 실패합니다.
다른 컴퓨터에서 들어오고 해당 컴퓨터의 기본 디스플레이에 있고 X를 실행하고있는 경우 "ssh -X hostname"을 사용하여 해당 호스트에 연결할 수 있으며 ssh는 X 디스플레이를 다시 전달합니다. . ssh는 또한 DISPLAY 환경 변수가 올바르게 설정되었는지 확인합니다 (위에서 언급 한 다양한 도트 파일에서 엉망이되지 않는 경우). "ssh -X"세션에서 DISPLAY 환경 변수는 "localhost : 11.0"과 같은 값을 가지며, ssh가 로컬 상자로 터널링하는 소켓을 가리 킵니다.
X11 환경에서 실행하고 있습니까? 터미널 창을 사용할 수 있지만 X 내에 있어야합니다 (그래픽 로그인 후 또는 startx를 실행하여).
이미 그래픽 환경에있는 경우 쉘 (bash, sh 등)과 같은 bash의 경우 export DISPLAY = : 0을 시도하고 C 쉘 기반 쉘 (csh, tcsh 등)의 경우 setenv DISPLAY : 0을 시도하십시오.
SSH를 통해 다른 컴퓨터에서 연결 한 경우 -X 옵션을 사용하여 앉아있는 컴퓨터의 그래픽 인터페이스를 표시합니다 (여기서 실행되는 X 서버가있는 경우 (예 : Windows 용 xming 및 표준 Linux X 섬기는 사람).
PuTTy에서 X11 전달 을 활성화해야합니다.
그렇게하려면 PuTTy를 열고 Connection => SSH => Tunnels 로 이동 하여 Enable X11 forwarding을 선택합니다.
Also sudo to server and export the below variable here IP is your local machine's IP
export DISPLAY=10.75.75.75:0.0
One more thing that might be the problem in a case similar to described - X is not forwarded and $DISPLAY is not set when 'xauth' program is not installed on the remote side. You can see it searches for it when you run "ssh -Xv ip_address", and, if not found, fails, which's not seen unless you turn on verbose mode (a fail IMO). You can usually find 'xauth' in a package with the same name.
Very Easy, Had this same problem then what i did was to download and install an app that would help in displaying then fixed the error.
Download this app xming:
http://sourceforge.net/project/downloading.php?
Install, then use settings on this link:
http://www.geo.mtu.edu/geoschem/docs/putty_install.html or follow this steps:
Installing/Configuring PuTTy and Xming
Once PuTTy and Xming have been downloaded to the PC, install according to their respective instructions.
Configuring Xming
Once Xming is installed, run the application called 'XLaunch' and verify that the settings are as shown:
- select Default entries on Display Settings windows, click next
- click next on Session Type window.
- click next on Additional parameters window(Notice clipboard checkbox is true)
- save configuration and click to finish.
Configuring PuTTy
After installing PuTTy, double-click on the PuTTy icon on the desktop and configure as shown:
This shows creating a login profile then saving it.
- On ssh -> X11, click on checkbox to enable X11 forwarding.
- on X display location textbox, type localhost:0.0
save profile then connect remotely to server to test.
Cheers!!!
I have had the same issue in Ubuntu 14.04.01 when I tried to install JDK 8 and Netbeans if I launch the script inside a Byobu terminal (maybe with Screens happens the same).
Just exit Byobu and (in a graphical terminal) run the script.
Initial Check.
1) When you are exporting the DISPLAY to other machine, ensure you entered the command xhost +
on that machine. This command allows to other machine to export their DISPLAY on this machine. There may be security constraints, just know about it. Need to check ssh -X MachineIP
will not require xhost +
?
2) Some times JCONSOLE
won't show all its process, since those JVM process may run with different user and you are exporting the DISPLAY with another user. so better follow CD_DIR>sudo ./jconsole
3) In WAS (WEBSPHERE); jconsole won't be able to connect its java server process, that time just go till the link, then try connecting it. This worked for me. May be this page is initializing some variables to enable jconsole to connect with that server.
WAS console > Application servers > server1 > Process definition > Java Virtual Machine
I have faced the same issue with AIX (where command line interface only available, There is no DISPLAY UI) machine. I resolved by installing
NX Client for Windows
Step 1: Through that Windows machine, I connected with unix box where GUI console is available.
Step 2: SSH to the AIX box from that UNIX box.
Step 3: set DISPLAY like "export DISPLAY=UNIXMACHINE:NXClientPORTConnectedMentionedOnTitle"
Step 4: Now if we launch any programs which requires DISPLAY; it will be launched on this UNIX box.
VNC
If you installed VNC on UNIX box where display is available; then Windows and NX Client is not required. Step 1: Use VNC to connect with Unix box where GUI console is available.
Step 2: SSH to the AIX box from that UNIX box.
Step 3: set DISPLAY like "export DISPLAY=UNIXMACHINE:VNCPORT"
Step 4: Now if we launch any programs which requires DISPLAY; it will be launched on this UNIX box.
ELSE
Step 1: SSH to the AIX box from that UNIX box.
Step 2: set DISPLAY like "export DISPLAY=UNIXMACHINE:VNCPORT"
Step 3: Now if we launch any programs which requires DISPLAY; it will be launched on this UNIX box.
For those who are trying to get an X Window application working from Windows from Linux:
What worked for me was to setup xming server on my windows machine, set X11 forwarding option in putty when I connect to the linux host and put in my windows ip address with the display port and then the display variable with my windows IP address:0.0
Dont forget to add the linux hosts IP address to the X0.hosts file to ensure that the xming server accepts traffic from that host. Took me a while to figure that out.
There are many ways to do this. I did something below convenient to me and always works fine.
- On your remote server, make sure to install xorg-x11-xauth, xorg-x11-font-utils, xorg-x11-fonts.
- Run the Xming Server on you local desktop
- On putty, before ssh to the server, enable the X11 forwarding and set the display location to localhost:0.0
On the server, .Xauthority file is generated and notice that the DISPLAY variable is already set.
$ xauth list
$ xauth add
To test it, type xclock or xeyes
Note: To switch user, copy the .Xauthority file to the home directory of the respective user and also export the DISPLAY variable from that user.
Don't forget to execute "host +" on your "home" display machine, and when you ssh to the machine you're doing "ssh -x hostname"
참고URL : https://stackoverflow.com/questions/662421/no-x11-display-variable-what-does-it-mean
'Programing' 카테고리의 다른 글
SQL Server에서 비트 필드를 인덱싱해야합니까? (0) | 2020.08.29 |
---|---|
C ++에서 임시 수명 보장? (0) | 2020.08.29 |
C #에서 목록이 비어 있는지 확인 (0) | 2020.08.28 |
Visual Studio 디버깅 "빠른 조사"도구 및 람다 식 (0) | 2020.08.28 |
파이썬 람다 식에 여러 문을 가질 수 있습니까? (0) | 2020.08.28 |