| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]"> |
| <title> |
| Creating a new JAR file |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script> |
| </head> |
| <body> |
| <h1> |
| Creating a new JAR file |
| </h1> |
| <p> |
| To create a new JAR file in the workbench: |
| </p> |
| <ol> |
| <li> |
| In the Package Explorer, you can optionally pre-select one or more Java elements to export. |
| (These will be automatically selected in the |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.file.export(exportWizardId=org.eclipse.jdt.internal.ui.jarpackager.JarPackageWizard)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <strong>JAR Package Specification</strong></a> wizard |
| page, described in Step 4.) |
| </li> |
| <li> |
| Either from the context menu or from the menu bar's <strong>File</strong> menu, select <strong>Export</strong>. |
| </li> |
| <li> |
| Select <strong>JAR file</strong>, then click <strong>Next</strong>. |
| </li> |
| <li> |
| In the <strong>JAR Package Specification</strong> page, select the resources that you want to export in the <strong>Select the resources to |
| export </strong>field. |
| </li> |
| <li> |
| Select the appropriate checkbox to specify whether you want to <strong>Export generated class files and resources</strong> or <strong>Export Java source files and |
| resources</strong>. <strong>Note</strong>: Selected resources are exported in both cases. |
| </li> |
| <li> |
| In the <strong>Select the export destination</strong> field, either type or click <strong>Browse</strong> to select a location |
| for the JAR file. |
| </li> |
| <li> |
| Select or clear the <strong>Compress the contents of the JAR file</strong> checkbox. |
| </li> |
| <li> |
| Select or clear the <strong>Overwrite existing files without warning</strong> checkbox. If you clear this checkbox, then you will be prompted |
| to confirm the replacement of each file that will be overwritten. |
| </li> |
| <li> |
| <strong>Note</strong>: The overwrite option is applied when writing the JAR file, the JAR description, and the manifest file. |
| </li> |
| <li> |
| You have two options: |
| <ul> |
| <li> |
| Click <strong>Finish</strong> to create the JAR file immediately. |
| </li> |
| <li> |
| Click <strong>Next</strong> to use the JAR Packaging Options page to set advanced options, create a JAR description, or change the default |
| manifest. |
| </li> |
| </ul> |
| </li> |
| </ol> |
| <p> |
| <img src="../images/ngrelc.png" alt="Related concepts" border="0" > |
| </p> |
| <p> |
| <a href="../concepts/concepts-1.htm">Java development tools (JDT)</a></p> |
| <p> |
| <img src="../images/ngrelt.png" alt="Related tasks" border="0" > |
| </p> |
| <p> |
| <a href="tasks-113.htm">Adding a JAR file to the build path</a><br> |
| <a href="tasks-115.htm">Attaching source to a JAR file</a><br> |
| <a href="tasks-35.htm">Defining the JAR file's manifest</a><br> |
| <a href="tasks-34.htm">Setting advanced options</a> |
| </p> |
| <p> |
| <img src="../images/ngrelr.png" alt="Related reference" border="0" > |
| </p> |
| <p> |
| <a href="../reference/ref-export-jar.htm">JAR file exporter</a><br> |
| <a href="../reference/ref-view-package-explorer.htm">Package Explorer</a> |
| </p> |
| |
| </body> |
| </html> |
| |