• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Deployment] Calling JAR inside WAR

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear experts,

I hope this is the right place to post such question. I have a web and desktop app developed using netbeans and to be built into a JAR(J) and WAR (W) file. I would like to know if it is possible for the (J) to call some other JAR (or .class) inside the (W)? Our ultimate goal is to share common classes between two apps, and hopefully no need to re-build the (J) when (W) is modified, or vice-versa. I hope my explaination is clear enough. Any comments and sugguestions is welcomed and appreciated, thanks.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any jar file placed in the WEB-INF/lib directory of a WAR will be accessible to classes in the web application. Have a look here for an example.
 
Eugene Wong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe, is there any way I can call the jars in WEB-INF/lib/ inside a war, from an external project?
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. If you are concerned with the effort it will take to keep your JAR and WAR updated and in sync, automate your build process with Ant.
 
reply
    Bookmark Topic Watch Topic
  • New Topic