• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

packing java file into JAr file

 
Ranch Hand
Posts: 588
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java class file and its supporting jar files and want to pack it JAR,how It can be done.I read that ,packing jar inside a jar create problem
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Packing a jar into a jar doesn't cause a problem, per se; but the Java class loader won't know how to load classes from those "nested jars", so it won't accomplish anything useful, either.
 
jacob deiter
Ranch Hand
Posts: 588
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then please tell how it can be done??
 
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Distribute your library JAR files next to your program JAR file:
The manifest can then specify those JAR files in the Class-Path attribute:
Of course you should put all your library JAR files either in the same folder, or all in a subfolder like lib. That's just more consistent.
 
    Bookmark Topic Watch Topic
  • New Topic