Exception in thread "main"

Jim Redman jim@ergotech.com
Wed Oct 30 15:58:00 GMT 2002

A number of times today while trying to get some code to run with gcj 
I've encountered this:

Exception in thread "main"

I can't figure out a pattern.  One was corrected by changing the line:

     Dimension d =  Toolkit.getDefaultToolkit().getScreenSize();


    Dimension d = new Dimension(640, 480);

But that same Toolkit...... code seems to have run elsewhere.  It's 
currently showing up on "add" in an applet.  My component does not get 
the "addNotify" which, I think, is the next entry into my code.

If I break in GDB I get the stack below.  Anyone have any thoughts or 

Program received signal SIGINT, Interrupt.
[Switching to Thread 8192 (LWP 10989)]
0x420cdb44 in read () from /lib/i686/libc.so.6
(gdb) bt
#0  0x420cdb44 in read () from /lib/i686/libc.so.6
#1  0x405f54e8 in __JCR_END__ () from /usr/lib/libgcj.so.3
#2  0x4038747c in 
java.lang.String[]) (
     this=0x8126e58, progarray=0x8190a38, envp=0x0) at 
#3  0x4027b7b4 in java.lang.Runtime.exec(java.lang.String[], 
java.lang.String[]) (this=0x8126fa8,
     progarray=0x8145e00, envp=0x0) at 
#4  0x4027b732 in java.lang.Runtime.exec(java.lang.String, 
java.lang.String[]) (this=0x8126fa8, prog=0x816c570,
     envp=0x0) at ../../../libjava/java/lang/Runtime.java:42
#5  0x4027b69c in java.lang.Runtime.exec(java.lang.String) 
(this=0xfffffe00, prog=0x816c570)
     at ../../../libjava/java/lang/Runtime.java:33
#6  0x402852b2 in 
     writer=0xfffffe00) at ../../../libjava/java/lang/Throwable.java:60
#7  0x4028508b in 
(this=0x81669c0, wr=0x8166970)
     at ../../../libjava/java/lang/Throwable.java:130
#8  0x40285053 in 
(this=0x81669c0, ps=0x814af90)
     at ../../../libjava/java/lang/Throwable.java:123
#9  0x4028485c in 
java.lang.Throwable) (
     this=0xfffffe00, thread=0x8169fc0, t=0x81669c0) at 
#10 0x4026c00d in _Jv_ThreadRun(java::lang::Thread*) () from 
#11 0x4023878c in _Jv_RunMain(java::lang::Class*, char const*, int, 
char const**, bool) ()
    from /usr/lib/libgcj.so.3
#12 0x402388ad in JvRunMain () from /usr/lib/libgcj.so.3
#13 0x0805892d in main (argc=1, argv=0xbffff934) at 


Jim Redman
(505) 662 5156

More information about the Java mailing list