• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a Jar (NON executable) with all the dependencies

 
Jayanath Amaranayake
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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.
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Class-Path manifest property. It should be a location relative to the JAR file itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic