I am currently working on a Java project in Eclipse that includes 44 java files and 1 SQL file. After working on it for several hours today, I noticed that nothing I was doing affected the program when I ran it (I could delete all the code in the main class and it still ran fine). I checked the class files and noticed they had not been modified for several days (since the last time I worked on it). After doing some reading online, I took the advice to perform Project->Clean. However, after doing that, I can no longer compile the project. When I run the main class I simple get this:
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: sprint1/Main2
Caused by: java.lang.ClassNotFoundException: sprint1.Main2
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I have checked the build path and from what I can tell everything seems correct. I have also toggled Project->Build Automatically on and off to no avail. The only thing I can think of to do now is create a new project and copy all the code to it, but I am using various obscure jars and SWT (which doesn't transfer well, if at all, in my experience). Can anyone help me out with this?
Are you sure there are no build errors in any of your classes? If there are errors, eclipse would could run the previous error free version (according to some settings you provide). Build errors can also lead to the class files not being generated after a project clean.