Make JVM use My Own Class Loader
Hi,
I wrote my own class loader.
I need all My classes to be loaded using my class loader.
I have passed the VM the following: -Djava.system.class.loader=MyClassLoader
Only the first referenced class in my package is being loaded using my class loader,
Other classes in my package are being loaded using AppClass loader.
Is there a way that I can force using my class loader?
Thanks,
Re: Make JVM use My Own Class Loader
The default behavior of class loaders is to delegate to their parent class loader before attempting to load a class themselves. So unless you override that behavior, a custom class loader will only load classes the system class loader can't find. And if you do override that behavior, it can create other problems.