Rather than generating native executables, the java compiler generates .class files, some of which are executable. In order to execute the .class files, you just run "java " where is the name of the class (and the class file), is case-sensitive, and doesn't include the ".class" extension.
One extra restriction exists that requires that a public class in Java must be declared in a file with the same name (i.e. .java). For Java users, the best case is that you specify a classname, and they submit their code as .java, and you save it as the same for compiling, and then you run java to run their submission.
Depending on how the rest of your system is built, that might not be reasonable (in particular, you may have reasons to save the java source file with a different name). SPOJ appears to have this problem, and what they do instead is require the executable class to be called "Main", and the class isn't declared public. (So the user submits a java file with a "class Main" that looks something like examples in this forum, and the judge just runs "java Main").