My application have this custom classloader:
JarByteClassloader loader = new JarByteClassloader(jar);
Class c = loader.loadClass(classToLoad);
Thread.currentThread().setContextClassLoader(loader);
JarEntryObject jarEntry = (JarEntryObject) c.newInstance();
I'd like to ask if it's possible to restrict access to specific classes from the instances loaded by a custom classloader?
As such, for example, System.getProperty()
or System.getenv()
should fail. In what way can this be done?