• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamically loading a class file from a jar file

 
Srinivas Ramgopal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I wrote a java program to load a .class file from a jar file.
The .class file resides in a different namespace than that of this java program.

I am using Class.forName(fully qualified class name) which is throwing a java.lang.ClassNotFoundException exception during runtime.

Code is as follows:



Any input is highly appreciated.

Thanks in advance.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that's how to dynamically load a JAR. Try to use URLClassLoader.

 
Bert Bates
author
Sheriff
Posts: 8905
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
off to the intermediate forum
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic