| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html lang="en"> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2010. 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"> |
| <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" type="text/javascript"> </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" alt="Opens the JAR export wizard"> |
| <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> |
| Expand the <strong>Java</strong> node and select <strong>JAR file</strong>. Click <strong>Next</strong>. |
| </li> |
| <li> |
| In the <strong>JAR File 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 <a href="tasks-34.htm">set advanced options</a>, create a JAR description, or <a href="tasks-35.htm">change the default |
| manifest</a>. |
| </li> |
| </ul> |
| </li> |
| </ol> |
| <p> |
| <img src="../images/ngrelt.png" alt="Related tasks" border="0" > |
| </p> |
| <p> |
| <a href="tasks-34.htm">Setting advanced options</a><br> |
| <a href="tasks-35.htm">Defining the JAR file's manifest</a><br> |
| <a href="tasks-36.htm">Regenerating a JAR file</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/views/ref-view-package-explorer.htm">Package Explorer</a> |
| </p> |
| |
| </body> |
| </html> |
| |