Example: I have the source code, FooBar.java
FooBar.java
javac FooBar.java
which gives me FooBar.class .
FooBar.class
Why does the JVM command line API accept FooBar instead of FooBar.class (works with UNIX FYI)?
FooBar
This is just a convention! Classes are loaded using their fully qualified class name. ClassLoader then knows how to map class names to file names (for example, by adding ".class").
ClassLoader
Just because you need to tell the JVM the name of the class you want to run, and not its actual file name. Another example: if your class was myPackage / FooBar.java, you would compile myPackage / FooBar.class, although you would put myPackage.FooBar as a jvm argument.