在HP-UX上使用JRE 8运行基于GUI的Java应用程序时出现以下错误:
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'ravkumar-t430.apac.tibco.com:1.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$300(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:126)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:79)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
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 java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:861)
at java.awt.Toolkit$2.run(Toolkit.java:856)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:855)
at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2020)
at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:579)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1356)
at javax.swing.UIManager.initialize(UIManager.java:1466)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1433)
at javax.swing.UIManager.getDefaults(UIManager.java:666)
at com.tibco.administrator.wizard.WizardDialog.setUIFont(WizardDialog.java:208)
at com.tibco.administrator.du.DomainUtility.a(DomainUtility.java:616)
at com.tibco.administrator.du.DomainUtility.main(DomainUtility.java:450)
但是一旦我使用JRE 7而不是JRE 8,那么就会解决问题并且应用程序正常运行。
当我在应用程序中设置java.awt.headless = true属性时,它会给出java.awt.headless异常。
请建议我解决方案。
答案 0 :(得分:1)
这是HP-UX操作系统中的一个错误,它会在使用64位JRE的X11显示时产生问题。安装最新的OS修补程序PHSS_43291后,此问题已得到解决。
http://h20564.www2.hp.com/hpsc/doc/public/display?docId=pdb_na-PHSS_43291&sp4ts.oid=3367737
此问题有两种解决方案:
1 /切换到32位jre
2 /在11.31上安装最新补丁。