Skip to content
Advertisement

Tag: compiler-construction

Java ClassLoader: load same class twice

I have a ClassLoader which loads a class compiled by JavaCompiler from a source file. But when I change the source file, save it and recompile it, the ClassLoader still loads the first version of the class. What am I missing? like a newInstance or something? Answer A classloader can’t replace a class that already has been loaded. loadClass will

Advertisement