The Artima Developer Community
Sponsored Link

Java Answers Forum
Changing search order of ClassLoader

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paul Reiners

Posts: 8
Nickname: reiners
Registered: Mar, 2003

Changing search order of ClassLoader Posted: Feb 12, 2008 11:03 AM
Reply to this message Reply
Advertisement
I have a ClassLoader that has already loaded a definition of a class. However, I want to replace the existing definition of the class with that from a .class file on disk.

I know that if I call the

public URLClassLoader(URL[] urls,
                      ClassLoader parent)


constructor, I can add the URL containing the directory containing the .class file. However, "The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader." I want the URLs searched first, since they contain the new class definitions that I want to use in place of the old ones.

I can only use Java 5, not Java 6.

Is there a way I can do this? A way I can replace the definition of an already defined class with a new definition?

Topic: Changing search order of ClassLoader Previous Topic   Next Topic Topic: Seeking Search Engine Enthusiast

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use