Why do you remove .class when executing on the JVM?

java, jvm, jvm-arguments

Solution

That's just a convention! Classes are loaded using their fully qualified class name. The `ClassLoader` then knows how to map class names to file names (e.g. by appending '.class').

Problem

Example: I have some source code, `FooBar.java` ``` javac FooBar.java ``` that gives me `FooBar.class`. Why does the JVM command line API take `FooBar` instead of `FooBar.class` (working on UNIX FYI)?

Original source

Related problems