Jump to content
Changes to the Jaspersoft community edition download ×

java.lang.NoClassDefFoundError: sun/awt/X11Gr

Recommended Posts

By: pke - eklarkar

java.lang.NoClassDefFoundError: sun/awt/X11Gr

2005-03-14 05:05

Hi there,

I have used jasper to produce the reports in java/j2ee architecture. I have been able to generate the reports on my side. But when the same code is run on diff env/location I am getting the error as follows


'java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment');

' at java.lang.Class.forName1(Native Method)');

' at java.lang.Class.forName(Class.java(Compiled Code))');

' at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:72)');

' at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:102)');

' at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:213)');



Can any one help me with this. Thanks in advance.



By: Jorn T. Nordahl - jorntnordahl

RE: java.lang.NoClassDefFoundError: sun/awt/X11Gr

2005-03-14 09:06

Headless server? I know we have had a problem with creating jasper reports on a headless server... if this is true, let me know, and I'll dig up what we had to do.



By: pke - eklarkar

RE: java.lang.NoClassDefFoundError: sun/awt/X11Gr

2005-03-16 03:05


thanks for your reply... I tried to set the server property "java.awt.headless" to true using

System.setProperty("java.awt.headless", "true")

still its not working...and this server is running on linux environment...is that a problem???




By: Daren O - rckrll106

RE: java.lang.NoClassDefFoundError: sun/awt/X11Gr

2005-03-16 05:48

Not sure if this will help but when we had X11 errors on our solaris system all we had to do is reset the DISPLAY variable.


So in a start up script for your app try something like:






By: pke - eklarkar

RE: java.lang.NoClassDefFoundError: sun/awt/X11Gr

2005-03-16 06:38


We are using WSAD5.1. Here i did not find where to set this DISPLAY value and also please let me know what is this DISPLAY for. Is it version?





By: Daren O - rckrll106

RE: java.lang.NoClassDefFoundError: sun/awt/X11Gr

2005-03-16 07:08

Again this is only for sun systems not a windows machine (just making that clear).


So this isn't a java or jasper issue and more of a sun system issue.


Sun's AWT requires an X server to operate. You must have your DISPLAY variable set to a functioning X server.

For example: setenv DISPLAY=localhost:0.0 export DISPLAY


If WSAD5.1 has a start up script you most likely could set it in there.


Maybe jasper has some parameter to set that I'm not aware of? However this fixed our problem. We use jboss and just added that line to the start up script.



By: Henrik Steudel - borti

RE: java.lang.NoClassDefFoundError: sun/awt/X

2005-03-22 01:04

This problem has been discussed several times. go search for term "headless" in the forum.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...