Error message “Bad Magic Number”

Each class file starts with special 4 bytes equal to the hexadecimal value of 0xCAFEBABE – this number identifies the class file format and is humorously named “Magic Number”. When you get an error from the JVM saying “Bad Magic Number”, it simply means the class file it is trying to load is corrupt.

The solution is usually to recompile all your classes.