File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment" Watch "java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment" New topic
Author

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

srini carry
Ranch Hand

Joined: Nov 30, 2007
Posts: 83
I getting this error in unix. Google suggested that I should set this property. -Djava.awt.headless=true I am running weblogic , please help where can I specify thsi property which filw is it user properties or weblogic specific?
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
You set headless to true when Jre cannot get the graphics initialized in the environment in which your application is running. The abstract Windows toolkit requires that. It needs to be set on the console.

Aren't you accessing your application via a web browser, you are using weblogic, right?

Regards


Experience and talent are independent of age
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
Dear

You set it on the command line, or more commonly in the start script that starts your weblogic server. We can't help you with the specifics, because you have not told us which flavour of UNIX you use.

Also, consider unsetting the DISPLAY variable, to avoid your server attaching to the local X11 display or a ssh forwarded display.

Kees Jan


Java-monitor, JVM monitoring made easy <- right here on Java Ranch
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

-Djava.awt.headless=true is a JVM parameter, so it would go into the "java" command that runs WebLogic. You might ask in the WebLogic forum how to set it. Or look at WebLogic's startup script to see where it reads its JVM parameters from.


Customer surveys are for companies who didn't pay proper attention to begin with.
srini carry
Ranch Hand

Joined: Nov 30, 2007
Posts: 83
Kees Jan Koster wrote:Dear

You set it on the command line, or more commonly in the start script that starts your weblogic server. We can't help you with the specifics, because you have not told us which flavour of UNIX you use.

Also, consider unsetting the DISPLAY variable, to avoid your server attaching to the local X11 display or a ssh forwarded display.

Kees Jan


how can I find the UNIX flavour ?
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
Dear srini,

Try using uname(1) for that. Like so:

srini carry
Ranch Hand

Joined: Nov 30, 2007
Posts: 83
Kees Jan Koster wrote:Dear srini,

Try using uname(1) for that. Like so:



thank you for the quick reply

here the result


SunOS acfas01 5.9 Generic_118558-20 sun4u sparc SUNW,Sun-Fire-280R

now trell me what next.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment