I would take Jon's suggestion and use Ant, since this is a pretty complex task.
However, if you are determined to get it all in one line in the Terminal, on Linux you could use the find command. But I don't recommend this at all, since there's no guarantee that, say, Foo.java will be compiled after Bar.java, even though Foo uses Bar. An example would be:
find . -type f -name "*.java" -exec javac {} \;
If all of your classes haven't been compiled yet, if there's one main harness or driver class (basically the one containing your main method), compiling that main class individually should compile most of project, even if they are in different folders, since Javac will try to the best of its abilities to resolve dependency issues.
There is a way to do this without using a pipe character, which is convenient if you are forking a process from another programming language to do this:
If all you want to do is run your main class (without compiling the .java files on which the main class doesn't depend), then you can do the following:
cd <root-package-directory>
javac <complete-path-to-main-class>
This will compile all the files and put the class files inside classes directory.
Now easy way to create FilesList.txt is this:
Go to your source root directory.
dir *.java /s /b > FilesList.txt
But, this will populate absolute path. Using a text editor "Replace All" the path up to source directory (include \ in the end) with "" (i.e. empty string) and Save.
The already existing answers seem to only concern oneself with the *.java files themselves and not how to easily do it with library files that might be needed for the build.
A nice one-line situation which recursively gets all *.java files as well as includes *.jar files necessary for building is:
javac -cp ".:lib/*" -d bin $(find ./src/* | grep .java)
Here the bin file is the destination of class files, lib (and potentially the current working directory) contain the library files and all the java files in the src directory and beneath are compiled.