Results 1 to 2 of 2
Thread: Make JVM use My Own Class Loader
- 11-18-2011, 02:27 PM #1Member
- Join Date
- Nov 2011
- Rep Power
Make JVM use My Own Class Loader
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?
- 11-18-2011, 10:41 PM #2
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.Get in the habit of using standard Java naming conventions!
- By katturv in forum New To JavaReplies: 1Last Post: 01-10-2011, 07:30 AM
- By kg1 in forum Advanced JavaReplies: 2Last Post: 12-06-2010, 10:41 PM
- By alacn in forum New To JavaReplies: 6Last Post: 08-11-2010, 10:51 PM
- By OutOfMemory in forum Advanced JavaReplies: 0Last Post: 01-07-2010, 01:38 PM
- By JavaJunkie in forum New To JavaReplies: 1Last Post: 05-06-2009, 01:17 PM