File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Jar and manifest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar and manifest" Watch "Jar and manifest" New topic

Jar and manifest

Justin Samuel

Joined: Aug 16, 2007
Posts: 8
Hello All,

I am new to Java programming. Can you please suggest me of what exactly is a jar file and especially the manifest file within it.

-Justin Samuel
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Jar is a way to bundle all you java class files and resource for easy delivery .Imagine you want to email a set of files to your friend.For convenience you would zip that and attache in email.

It also has a MENIFEST.MF file for storing metadata information about the content of the jar.
Even you can put the main class name in an attribute of MENIFEST.MF file to make the jar executable.You can have your own custom attribures also.

Rahul Bhattacharjee
LinkedIn - Blog
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

See: The Java Tutorial - Packaging Programs in JAR Files

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Justin Samuel

Joined: Aug 16, 2007
Posts: 8
Thanks a lot for that explanation
I agree. Here's the link:
subject: Jar and manifest
It's not a secret anymore!