I am using Eclipse + Window Builder + few third party libraries to build a gui application,
Entry point for my application resides in MainWindow.java file, which also contains the gui of the application, other than that I have few helper classes.
My application works fine, but when I checked into bin folder I find four more class files there namely: 1. MainWindow$1.class 2. MainWindow$2.class 3. MainWindow$3.class 4. MainWindow$4.class.
Now I don't understand why these files are here, When I deleted these files, Eclipse throws an exception
Exception in thread "main" java.lang.NoClassDefFoundError: gui/MainWindow$1
at gui.MainWindow.main(MainWindow.java:71)
Caused by: java.lang.ClassNotFoundException: gui.MainWindow$1
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
the code that throws the exception is:
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainWindow window = new MainWindow();
window.frmMailExtractor.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
I am not able to find out why these files are there and who put them? any ideas?
OK so these are the anonymous classes, but why the Exception then?...and why can't I see them in my eclipse..becasue when I export it as a runnable jar, the jar throws the same exception