You can run your code with the -verbose:class flag, and you will see that loading the class is extremely lazy. The JVM only loads classes, which it must necessarily continue. If at the end of your program you do something that requires a class that was previously not absolutely necessary, it will be loaded just then.
This very well explains the error you received, and you should note that you should not replace the jar file (or class) that works, for this very reason.
source share