• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Jar file from Jar files

 
feda alshahwan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we run a jar file from a jar file?
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
feda alshahwan wrote:Can we run a jar file from a jar file?


Not directly. The Java classloader structure doesn't look inside embedded jars.

You can write a custom classloader that can be used to resolve the classes and class resources in an embedded jar, however. That's what programs such as the Tomcat webserver do, where a WAR (jar) contains jars in the WAR's WEB-INF/lib directory.
 
feda alshahwan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you but what is the algorithm of the custom classloader? Is their any ready API ?
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
feda alshahwan wrote:Thank you but what is the algorithm of the custom classloader? Is their any ready API ?


http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic