This is actually a behavioral detail which has changed in Java 7.
Prior to Java 7, whatever class is passed to the JVM as the application entry point, that class is loaded, initialized, and then the main method is looked up. Even if there's no such method, the class initialization code will have run. That includes any static initializers.
As of Java 7, the class will be loaded, but will not be initialized prior to looking up the main method. The JVM will abort with an error if the method is not found, and initialization will never occur.
Class loading vs. initialization
For many purposes this is just a subtle difference, but you have actually hit one where it is crucial. As per Java Language / Java Virtual Machine specifications, there is a clear distinction between:
class loading: this happens at any time, and for any class, the specific JVM implementation sees fit. It means loading the binary contents of the .class file, parsing them, verifying the bytecode, building up the constant pool, and so on;
class initialization: this happens at a precisely specified point, which is when the class is referred to (explicitly or otherwise) for the first time during a JVM run. At this point all the class initializers run.
mainmethod ?mainfrom the StaticBlock class but you are placing it in some other class that you are executing otherwise you are not execute anything