[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: JAVA AWT exception in debian



On Thu, 21 Jun 2007 09:43:47 -0700 (PDT)
yong lee <ylee_95116@yahoo.com> wrote:

> Yes, I am able to run a Swing application from a
> terminal window. 
> 
> Yong 
> --- Liam O'Toole <liam.p.otoole@gmail.com> wrote:
> 
> > On Wed, 20 Jun 2007 16:13:19 -0700 (PDT)
> > yong lee <ylee_95116@yahoo.com> wrote:
> > 
> > > I got a following exception when I ran a JAVA
> > program 
> > > which uses AWT in a terminal window. The same
> > program
> > > works in Windows environment. Do I miss some
> > > configuration settings in debian environment ?
> > Thanks
> > > -Yong
> > > 
> > > java.awt.HeadlessException
> > 
> > [...]
> > 
> > Maybe. Can you run any graphical programs at all
> > from the terminal
> > window? Can you run any other graphical Java
> > program, for example one
> > of the demos shipped with the JDK?

Then the problem probably lies with the program which throws the
exception. Yes, I know it works in a Windows environment, but even with
Java it is possible to write non-portable code. Is the source code 
available? Try writing a simple, "Hello World!" program using AWT for
comparison, e.g.,

import java.awt.*;

public class HelloWorld {
    public static void main(String[] args) {
        Frame f = new Frame();
        f.add(new Label("Hello World"));
        f.pack();
        f.setVisible(true);
    }
}



Reply to: