Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default 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,

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    5

    Default 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!

Similar Threads

  1. which class loader cexecutes first
    By katturv in forum New To Java
    Replies: 1
    Last Post: 01-10-2011, 06:30 AM
  2. java.system.class.loader Not Working
    By kg1 in forum Advanced Java
    Replies: 2
    Last Post: 12-06-2010, 09:41 PM
  3. class loader problems!
    By alacn in forum New To Java
    Replies: 6
    Last Post: 08-11-2010, 10:51 PM
  4. TCCL (Thread context class Loader) ???
    By OutOfMemory in forum Advanced Java
    Replies: 0
    Last Post: 01-07-2010, 12:38 PM
  5. Class loader
    By JavaJunkie in forum New To Java
    Replies: 1
    Last Post: 05-06-2009, 01:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •