I'm using Eclipse to learn swing programming. After a few runs of the program I got an out of memory error! Felt quite good cos i'd never got a java error in my program before but i hope it's not a sign of things to come. While investigating the reason for the error i found that there were 18 javaw.exe processes running in the background - (i'm using windows by the way). Everytime i start my program one more is added and when i close the program this process is not killed even though i use System.exit() in my Windowclosing listener. i presume it's some sort of memory leak but how do i stop it? Is my hypothesis right? what is javaw?
found on java.sun.com: The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason. try a System.exit(0)
How are you using System.exit( 0 )? The only reason I've seen Eclipse "hang" javaw calls is when the JVM is still running. Are you calling System.exit() inside the windowClosing() method of a WindowListener attached to your window? The default close operation (unless you set it yourself) is just to hide the frame on close, which leaves the JVM running.
Either call setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ) on your JFrame and don't do the listener yourself, or double check the listener to make sure it's actually attached to the JFrame. Also, if you are extending WindowAdapter make sure the windowClosing method signiture matches exactly or you aren't actually overriding it.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.