• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Headless Exception

 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

When i tried to call an legacy applet class , i get this exception

Exception : java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.

i have no clue about the class , except that it extends Applet. Can someone explain what this X11 all about ? When such exceptions occurs ?

 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you trying to run the applet? Are you inside a windowed environment like KDE, GNOME, Xfce, ...? Or do you only have a terminal?

Since DISPLAY is not set (which will mostly happen automatically when starting KDE, GNOME etc) my guess is the latter, and that makes it hard to display the applet (or any GUI). Because the JVM cannot find a proper environment to display on it will throw a HeadlessException.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Rob ,

I have added this java -Djava.awt.headless=true to skip the exception. I did this just because the use of that file is pack String arrays , and not sure why it extends Applet ?!?! so anyways Thanks and things working fine..

Does this suppression (-Djava.awt.headless=true ) has any consequences ?
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Balu Sadhasivam wrote:the use of that file is pack String arrays , and not sure why it extends Applet ?!?!


Bad design obviously.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:

Balu Sadhasivam wrote:the use of that file is pack String arrays , and not sure why it extends Applet ?!?!


Bad design obviously.



Well thats part and parcel of legacy systems..
 
reply
    Bookmark Topic Watch Topic
  • New Topic