The weird part is it loads the class just fine.
You are probably talking about Javassist, but the fact that Javassist can read the class file does not mean that the class was classloaded by the JVM.
You should change your code to :
public static void main(String[] args) throws Exception {
// Ensure Standard class classloading by creating an instance
// (calling a static method like Standard.init() would also do)
Standard standard = new Standard();
standard.doSomething();
ClassPool pool = ClassPool.getDefault();
CtClass clazz = pool.get("Standard");
HotSwapper swap = new HotSwapper(8000);
swap.reload("Standard", clazz.toBytecode());
}
This will ensure that the Standard
class was classloaded, hence can be reloaded.