• 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

Class-Path Limits in Jar Manifest Files

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Class-Path which has 11 jar files. If I use their real names, I go over what seems to be a line/character limit. The generated Manifest file from the jar command shows a cr lf having been injected. This results in part of the listed jar files not being included; those forced onto the second line. If I use an additional Class-Path statement, the last Class-Path statement becomes the only one that is used. If I simply put my list on 2 lines with just one Class-Path statement, the jar command indicates a syntax error. The only solution so far is to rename all the jar files to 1 1 character names as indicated below. It may also be possible to nest Class-Path references within the manifest files of the "sub"jars, so that the list at the top can be shortened.
There must be a better solution out there! The single character listing below does work however but there must be some special syntax to make this work with longer file names.
jar cvfm output.jar myManifest com *.jar
Manifest-Version: 1.0
Main-Class: com.mine.myclass
Class-Path: a.jar b.jar c.jar d.jar e.jar f.jar g.jar h.jar i.jar j.jar k.jar
Thanks
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know if this solution will work or not, but how about compressing all these jar files in a single jar file and including it in the classpath?
- Manish
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is just a sample manifest file that I use; it has given me no problem:

I see the carraige returns in there, but it has given me no problem in actaully running -- this application is up and running with no problems.
Could this be a problem with different versions? I'm using 1.4.1_02, what java version are you using?
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic