cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
fancy3
Level 2

java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment

when using IA to build installers, there is a error like below if DISPLAY variable isn't set, and it could work if DISPLAY variable is set. I'm very confused why DISPLAY is required during the build.

java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:127)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:127)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:101)
at sun.font.FontManager.initSGEnv(FontManager.java:958)
at sun.font.FontManager.findFont2D(FontManager.java:1120)
at java.awt.Font.getFont2D(Font.java:385)
at java.awt.Font.getFamily(Font.java:984)
at java.awt.Font.getFamily_NoClientCode(Font.java:958)
at java.awt.Font.getFamily(Font.java:950)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGlm.a(DashoA10*..)
at ZeroGlm.a8(DashoA10*..)
at ZeroGlm.a(DashoA10*..)
at ZeroGl0.run(DashoA10*..)
Adding other errors: sun.awt.X11GraphicsEnvironment (initialization failure) (java.lang.NoClassDefFoundError)

Could some one help on this? Thanks!
Labels (1)
0 Kudos
(3) Replies
pv7721
Level 20

This is most likely because there's an old issue where the build command-line tool, while it should have been a console-only application, it isn't it really one (I remember that it was capable of throwing GUI-like pop-up error messages, when it shouldn't have). So this is why you need to have a DISPLAY variable defined for such a case.
0 Kudos
fancy3
Level 2

pv7721 wrote:
This is most likely because there's an old issue where the build command-line tool, while it should have been a console-only application, it isn't it really one (I remember that it was capable of throwing GUI-like pop-up error messages, when it shouldn't have). So this is why you need to have a DISPLAY variable defined for such a case.



Thanks for your response. So you mean "an old issue" is a bug of InstallAnywhere ?? Is there some way to fix this issue(actually I don't know what issue it is). Thanks.
0 Kudos
pv7721
Level 20

So, you originally asked about this issue of building IA installers using command line that doesn't work if the DISPLAY variable is not set. This I think it's bug yes. However your PM, you asked me something a little bit different:

I am getting the following error message when trying to use InstallAnywhere_2009_Enterprise to install my project onto a server that has no display attached. The errors exist if DISPLAY variable isn't set, and disappear if DISPLAY variable is set. I'm very confused why DISPLAY is required, what is it used for?

java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:127)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:127)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:101)
at sun.font.FontManager.initSGEnv(FontManager.java:958)
at sun.font.FontManager.findFont2D(FontManager.java:1120)
at java.awt.Font.getFont2D(Font.java:385)
at java.awt.Font.getFamily(Font.java:984)
at java.awt.Font.getFamily_NoClientCode(Font.java:958)
at java.awt.Font.getFamily(Font.java:950)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGq3.a(DashoA10*..)
at ZeroGlm.a(DashoA10*..)
at ZeroGlm.a8(DashoA10*..)
at ZeroGlm.a(DashoA10*..)
at ZeroGl0.run(DashoA10*..)
Adding other errors: sun.awt.X11GraphicsEnvironment (initialization failure) (java.lang.NoClassDefFoundError)

This project is very urgent, I need to figure out the root cause ASAP, Could you help on this? Thanks!


This however is something different, and the behavior is intended: IA installers by default are graphical installers, so they need to have their output displayed somewhere (thus the need for the DISPLAY variable being set). If you want to no longer have to set this variable before running the installer, you need to use the console (text) mode or silent install mode.
0 Kudos