Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prepend to java class path dynamically

 
Jiju Jacob
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am stuck with a strange problem.

I have a jar called abc.jar which runs my GUI application. Let us say that abc.jar has a class called Test.class.

My customer has a requirement that he would supply another jar called patch.jar whose path he would specify in the GUI application while it is already running. The patch.jar contains a replacement for Test.class. When the user specifies the path to the patch.jar and clicks on OK, i need to load the new Test.class from patch.jar instead of abc.jar

It is also safe to assume that Test.class has not been loaded till the point the patch.jar path has been specified by the customer and he has clicked ok.

How can this problem be solved?

Thanks,
Jiju
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to look into Java Classloaders.

Good luck, its complicated.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic