blob: 057c2755216829696da723877b032599eea6f88d [file] [log] [blame]
<!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&nbsp;<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&nbsp;</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&nbsp;<strong>Select the export destination</strong> field, either type or click&nbsp;<strong>Browse</strong> to select a location
for the JAR file.
</li>
<li>
Select or clear the&nbsp;<strong>Compress the contents of the JAR file</strong> checkbox.
</li>
<li>
Select or clear the&nbsp;<strong>Overwrite existing files without warning</strong> checkbox. If you clear this checkbox,&nbsp;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&nbsp;<strong>Finish</strong> to create the JAR file immediately.
</li>
<li>
Click&nbsp;<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>