AIX5.3 java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment解决之道

问题:IBM AIX5.3 java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment(initialization failure)

 

这个问题在我的这篇文章有所提及,下面是提及到的部分内容:

写道

遗憾&求助:打jar的问题是解决了,且在AIX上可执行, 但在AIX安装发布程序却问题依旧,终报错为:
$ sh install.sh
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
at IDEP.launchSetup(IDEP.java:293)
at IDEP.setup(IDEP.java:154)
at IDEP.main(IDEP.java:62)
Caused by: java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:136)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.(XToolkit.java:89)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:136)
at java.awt.Toolkit$2.run(Toolkit.java:846)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:838)
at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:140)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1557)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:142)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1592)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:542)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:582)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1346)
at javax.swing.UIManager.initialize(UIManager.java:1435)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1423)
at javax.swing.UIManager.getDefaults(UIManager.java:663)
at javax.swing.UIManager.put(UIManager.java:992)
at com.memoire.vainstall.VAGlobals.setLanguage(Unknown Source)
at com.memoire.vainstall.Setup.(Unknown Source)
... 7 more
Caused by: java.lang.InternalError: Can't connect to X11 window server using '132.104.64.177:0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:131)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:136)
at sun.swing.SwingUtilities2.isLocalDisplay(SwingUtilities2.java:1407)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
... 18 more

问题原因:telnet或字符模式下不能启动XGraphics图形界面

 

解决之道:可采用如下任一种(或顺其趋势提供启动XGraphics界面,或设法取消之)

写道
方案一:曲线救国

            借助Xmanager终端运行程序,可以启动XGraphics

方案二:操刀JDK参数

            在java命令行加入参数-Djava.awt.headless=true

方案三:操刀AIX

            创建并编辑SystemDefault.properties ,加入java.awt.headless=true

显然,方案二更具优势。

 

你可能感兴趣的:(UNIX)