You probably don’t want those classes in your ‘global’ clasdsloader, because you can’t get them out of there.
Just make a URLClassLoader with the ‘global’ ClassLoader as parent, and call loadClass() to get your plugin implementations. Whn you want to replace a plugin, just create a new classloader, from a new jar, with the same classnames.
Unfotunately, it is very recommended, to keep the JAR that is associated with your ClassLoader around. Otherwise, the JVM might crash, an most certainly will (!!). I think the JVM uses MappedByteBuffers and simply loads a new page in RAM whether the backing file has changed or not, then executes (?) the bytes - and there you have it, a native crash.
So either write your own classloader that grabs the whole JAR and keeps in it memory, or simply ensure you never overwrite or delete a JAR you’re using (copy all JARs to /tmp/ with a random name…?).