When I try to compile this class with javac, I get a compilation error and Test.class is not created.
public class Test {
public static void main(String[
Yes, Eclipse uses its own special compiler; known as "ecj". From Stack Overflow question What is the difference between javac and the Eclipse compiler?:
One notable difference is that the Eclipse compiler lets you run code that didn't actually properly compile. If the block of code with the error is never ran, your program will run fine. Otherwise it will throw an exception indicating that you tried to run code that doesn't compile.