4 Replies Latest reply on Sep 21, 2011 10:37 AM by Olaf Heimburger-Oracle

    Could not initialize class sun.awt.X11GraphicsEnvironment

    user11138293
      My application is failing because of java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment upon goggle search I found this [http://www.techienuggets.com/Comments?tx=14949]

      it basically says I have to specify

      -Djava.awt.headless

      where in weblogic startup files should I specify this , I dont have much knoweledge of starting weblogic in unix please tell me which file should I alter to specify this option ?
        • 1. Re: Could not initialize class sun.awt.X11GraphicsEnvironment
          david.karr
          Is this an admin server or a managed server started by NodeManager?

          If it's an admin server, you can edit the "setDomainEnv.sh" or "startWebLogic.sh" script (I'm not sure which is best, or where in the script it's best to make this change) in the domain/bin directory.

          If it's a managed server controlled by NodeManager, then go into the WebLogic admin console and edit the "Environment"->"Servers"->server definition, going to "General"->"Server Start", and edit the "Arguments" field.

          Edited by: david.karr on Jul 29, 2009 11:34 AM
          • 2. Re: Could not initialize class sun.awt.X11GraphicsEnvironment
            Olaf Heimburger-Oracle
            You must specify -Djava.awt.headless=true in the setDomainEnv.sh file. This has nothing to do with Unix systems as this option is available on every platform.

            --olaf                                                                                                                                                                                                                                                                                                                                                       
            • 3. Re: Could not initialize class sun.awt.X11GraphicsEnvironment
              801156
              I am getting this error on my browser when I try to load my ADF application hosted on weblogic managed server. What do I do to fix this and where do i specify this parameter in which file? Can this be done from the console too? Do i need to restart the weblogic server after?
              • 4. Re: Could not initialize class sun.awt.X11GraphicsEnvironment
                Olaf Heimburger-Oracle
                If you start the WLS server on the command line, set the JAVA_OPTIONS environment variable before starting the WLS Server.

                Ie (on Unix/Linux):

                export JAVA_OPTIONS=-Djava.awt.headless=true
                ./startWebLogic.sh

                HTH,
                --olaf