Error Details:
[[email protected] import_jre]# ./run_linux64/root/lyy/import_jre/root/lyy/import_jre/lib/root/ Lyy/import_jre/jre8_openjdk64/binclasspath is: /root/lyy/import_jre/lib/myapp.jar:/root/lyy/import_ jre/jre8_openjdk64/lib/ext:/root/lyy/import_jre/lib/lib/commons-io-2.0.1.jar:/root/lyy/import_jre/lib/lib/ Dom4j-1.6.1.jar:/root/lyy/import_jre/lib/lib/hgdb-1.3-jdbc41.jar:/root/lyy/import_jre/lib/lib/log4j-1.2.17.jar :/root/lyy/import_jre/lib/lib/poi4excel.jar:/root/lyy/import_jre/lib/lib/slf4j-api-1.7.2.jar:/root/lyy/import_ Jre/lib/lib/slf4j-log4j12-1.7.2.jarrun now ... no protocol specifiedexception in thread "main" java.awt.awterror: can ' t connect to X11 window server using ': 1.0 ' as the value of the display variable.at sun.awt.x11graphicsenvironment.initdisplay (Native Method) at sun.awt.x11graphicsenvironment.access$200 (X11graphicsenvironment.java:At sun.awt.x11graphicsenvironment$1.run (x11graphicsenvironment.java:187) at Java.security.AccessController.doPrivileged (Native method) at sun.awt.x11graphicsenvironment.< Clinit> (x11graphicsenvironment.java:146) AT&NBSP;JAVA.LANG.CLASS.FORNAME0 (Native method) at Java.lang.Class.forName (class.java:260) At java.awt.graphicsenvironment.createge (Graphicsenvironment.java : 102) At java.awt.graphicsenvironment.getlocalgraphicsenvironment (graphicsenvironment.java:81) at Sun.awt.x11.xtoolkit.<clinit> (xtoolkit.java:123) AT&NBSP;JAVA.LANG.CLASS.FORNAME0 (Native Method) at java.lang.class.forname (class.java:260) at java.awt.toolkit$2.run (toolkit.java:860) at Java.awt.toolkit$2.run (toolkit.java:855) at java.security.accesscontroller.doprivileged (Native Method ) At java.awt.toolkit.getdefaulttoolkit (toolkit.java:854) at Javax.swing.UIManager.getSystemLookAndFeelClassName (uimanager.java:611) At hgdbmonitor.view.moniTorview.main (monitorview.java:2147)
Error reason: Should look for error when looking for error prompt can ' t connect to X11 Window server using ': 1.0 ' as the value of the DISPLAY variable. We found two key points: X11 Windows Server and variable display.
Problem solving:
1. Through the query we learned that Linux by default is the start of X11 Windows Server, and it is related to the Windows Graphics tool display;
2. The value of the variable display is related to which graphical terminal is displayed on the machine, by executing the WHO command and the Who am I command, you can know that the current graphical terminal is nth (2nd below), then the value of the variable display should be IP: (n-1) or: (n-1) ( The following is: 1.0), only then the Java graphics program interface can be displayed properly.
[Email protected] import_jre]# whoroot tty2 2015-02-06 13:18root pts/1 2015-02-06 13:42 (192.168.100.126) Highgo p TS/2 2015-02-06 13:42 (: 1.0) [[email protected] import_jre]# who am ihighgo pts/2 2015-02-06 13:42 (: 1.0) [Email protecte D] import_jre]# echo $DISPLAY: 1.0
If the display value does not match, you can ask the administrator of the machine to see if the machine is turned on properly, or to find other graphics terminal visitors to turn off Remote Desktop access, keep only your remote Desktop, and then try to re-execute the program.
Reference: http://www.itpub.net/thread-1633000-1-1.html
Can ' t connect to X11 Window server using ': 1.0 ' as