[Home]How To Make A Java Jar File

Contents | (Visit Preferences to set your user name.) | Related To How To Make A Java Jar File | RecentChanges | Preferences | Index | Login | Logout

Featured: Featured Stories | Picture Gallery

About Sam | Electronics Chokes
Google
Chat11.com Web Bible11.com MyBibleCenter.com
Cover of ISBN 0672323079

Cover of ISBN 0761535225

Java Programming For The Absolute Beginner

Cover of ISBN 0596003471

Programming .NET Components

How To Make A Java Jar File

Subjects > ... > Java Programming

Compress Files To A Java Archive (JAR)
This is by far the most common use for JAR files: to compress multiple files into a single JAR archive. JAR files can be opened with WinZip?Create or WinRar?Create. In terms of Java applications, the ability to archive any number of source or class files into one single archive represents the biggest advantage - distributing one file containing hundreds of files is so much easier than distributing hundreds of files separately!

The jar utility program is run from the command line (DOS prompt or bash for example, depending on your OS). Here is how to create a compressed JAR file:

   jar cf archive_name.jar files
Let's look at each part of that command line.

jar The command to run the jar utility.

CF Create a new archive with the file name specified. These two options are from this list of common options:

- c create new archive - t list table of contents for archive - x extract named (or all) files from archive - u update existing archive - v generate verbose output on standard output - f specify archive file name - m include manifest information from specified manifest file - 0 store only; use no ZIP compression - M do not create a manifest file for the entries - i generate index information for the specified jar files - C change to the specified directory and include the following file

Multiple options can be used together. They all must appear after the "jar" command with no white space separating them.

archive_name.jar Name of the JAR file. This can only be included if you use the 'f' option.

files Names of all the files you want to put in the jar file. This could be just one name or a list of multiple names separated by space. Names can use pattern matching characters to match multiple files.

Related


Contents | (Visit Preferences to set your user name.) | Related To How To Make A Java Jar File | RecentChanges | Preferences | Index | Login | Logout
Edit this www.chat11.com page | View other versions
Last edited April 8, 2007 2:54 am (diff)
Search:
Sign up for PayPal and start accepting credit card payments
instantly.
Bobsgear - Get A Free Enterrpise Wiki Space!
Review: The Bobsgear Project was started to develop a variety of Confluence plugins. This installation of the Confluence Enterprise wiki includes flexible attachments, many Confluence plugins, personal blogs, interesting articles, and more. Bobsgear already has spaces related to politics, art and photography wiki, technical issues wiki, ediscovery wiki, health, Christian theology and Sabbath School wiki, the bible, book reviews, and quotations. Bobsgear allows free signup, and invites anyone to create a free hosted Confluence wiki space.


NEW USERS CLICK HERE! for a quick introduction to Wiki.

 

 Interested in Seventh-Day Adventist Thoughts On Recreation?
723 total hits since 8/2007
Recently accessed pages: Animals Disappearing From What Forests Remain On Singapores Sentosa Island Crafts Famous Love Quotation Laboratory Malaysia Pocket PC Voip Washington Man Dies From Intercourse With A Horse

Elapsed:1