I have written a simple class with one static block
class Hello { static { System.out.println(\"Hello\"); System.exit(0); } }
You need to probably put public static void main(String[] args){ } method in your class for JDK7. In JDK7, main method's presence is checked before the static block and if it doesn't find one you get the exception.
public static void main(String[] args){ }