Java security: Sandboxing plugins loaded via URLClassLoader
问题 Question summary: How do I modify the code below so that untrusted, dynamically-loaded code runs in a security sandbox while the rest of the application remains unrestricted? Why doesn't URLClassLoader just handle it like it says it does? EDIT: Updated to respond to Ani B. EDIT 2: Added updated PluginSecurityManager. My application has a plug-in mechanism where a third party can provide a JAR containing a class which implements a particular interface. Using URLClassLoader, I am able to load