Compiling error - just started happening, but why?

Hi, going a bit crazy here. Have been working on a small project (about 15 classes right now), and all was going well until today. Up until now, I've simply compiled using the command "javac f1m/F1M_main.java". I have this in a batch file, that also has a command to delete all class files first, just to keept things up to date). F1M_main.java being the file that contains the main class, in the directory f1m. I run the batch file from a directory one level above the source directory, f1m. All source files are in this directory, and all are in the same package (f1m).

Until today, this worked fine. If a class that F1M_main depended on didn't exist, but the source file of the same name did, it was compiled automatically. But today, when I tried to compile it using the same batch file, none of the classes I'd defined myself could be found (all "cannot find symbol" errors). Every single class. I tried building using the command javac f1m/*.java which seemed to compile (all class files were created), but if I try running using java f1m/F1M_main or java f1m.F1M_main, or java f1m/f1m.F1M_main, or even going into the f1m directory and trying from there, I always only get a NoClassDefFound error...

This is very confusing, as all this worked until today, and I hadn't changed anything (as far as I could tell) to cause it to stop working. Feeling frustrated, I went to a project I haven't touched for a few weeks, and tried compiling that (again, using a batch file that always worked). Again, same problem! None of my defined classes could be found... This all worked before, and I definitely haven't changed either the source or batch file for this project. What's happened? What's changed? I uninstalled / reinstalled java too, just to see...but nothing. Hmmm.

Does anyone have any ideas what might be going on? I'm sure it's something silly, but it does seem very odd :( Can anyone help? I think I'm going mad...!

[1962 byte] By [Waps77a] at [2007-10-1 17:38:48]
# 1
Try using an IDE. It does all that for you.If you have a class F1M_main in package called f1m, in a directory called f1m then you need to run the following from the top directory.javac f1m/F1M_Main.javajava -cp . f1m.F1M_main
Peter-Lawreya at 2007-7-11 3:56:13 > top of Java-index,Developer Tools,Java Compiler...
# 2

Thanks for the reply. Until the problem appeared yesterday, I'd always compiled from the top directory using javac f1m/F1M_main.java. This always worked, with all the dependencies being worked out...but for whatever reason, yesterday it suddenly couldn't find any of the subclasses, all defined in java files in the same directory, in the same package. This is what's odd (as is the fact that a previous, unchanged project also won't compile now). It's as though something in my Java setup have changed, or in the registry, or something... I had an automatic Java update today and half hoped it was correcting something that had gone wrong in a recent update I didn't realise I had...but alas no... I'll try looking for an IDE, but it's odd that the previously "tried and trusted" method has gone awry. As I mentioned, I had both the build and run commands in batch files (call javac f1m/F1M_main.java etc) so the way I've been building hasn't changed. The files haven't changed...but the results certainly have :(

Waps77a at 2007-7-11 3:56:13 > top of Java-index,Developer Tools,Java Compiler...
# 3

Another quick reply...

Ok, I tried adding the -cp . option when running, and that at least allows me to run the code :) I compiled using f1m/*.java (as opposed to just the main java file), which I didn't have to do before, but at least the thing is running again now. Thanks again for your help!

Chris

Waps77a at 2007-7-11 3:56:13 > top of Java-index,Developer Tools,Java Compiler...