This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Creating a Jar (NON executable) with all the dependencies

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have some set of utility java classes. They use commons bean utils and some other third party jar files. I created a jar of my utility classes (This jar is NOT executable as it contains only some utility classes that can be used by others) and added the Class-Path attribute to the manifest file at the time of the Jar file creation. However when another application is trying to use my utility classes jar, it fails with a ClassNotFound as my utility classes failed to find its dependencies.
May be I have missed something here. But below is a generic example of my scenario.

Utility.jar - has some utility classes and has no entry point with a main method
Dependancy1.jar - used in Utility.jar
Dependancy2.jar - used in Dependancy1.jar

Now, how should I create the Utility.jar properly, with all the dependencies.

Appreciate your help and many thanks for your time.
 
Sheriff
Posts: 22773
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the Class-Path manifest property. It should be a location relative to the JAR file itself.
 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic