• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Class-Path attribute in JAR manifest & class loader  RSS feed

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to call other jar files from current jar?

I try this:

Main-Class: CompressUtil
Class-Path: D:/my/lib/tar.jar D:/my/lib/activation.jar

but doesn't work. any idea? (I don't want to include those jar)

I read somewhere in google, need to use class loader, anyone can show me how?

thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A ClassPath in a jar file manifest must be relative to the jar file itself, not to the local file system. The convention is to simply list the jar file name without a path and plan to keep it in the same directory as the jar file you're creating.

So, you'd want to change your entry to:

Class-Path: tar.jar activation.jar

Another quirk of manifests in jar files is that you must have an extra line feed character at the end of the file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!