Creating a JAR File
To create a JAR file in the IDE, you must first create a JAR recipe. The JAR recipe stores information
about your JAR file, which you can later modify and use to create a new JAR file.
To create a JAR recipe:
- Choose File
New.
- In the first pane of the New wizard, expand the JAR Packager node. Then
choose JAR Recipe and click Next.
- In the Choose Name pane, enter:
Click Next.
- Select the files or directories you want to put in the JAR file and click
Add. You can select multiple files by holding down Control or Shift while
clicking file names and directories. When you add a directory to a JAR, you
also add all of its contents. Click Next to proceed.
- In the Modify JAR Recipe Contents pane, you can specify destination information
individually for each item you are adding to the JAR file.
The pane displays JAR recipe contents in three columns:
- Source. Displays all files and directories you have specified
to include your JAR file. If you chose to include an entire directory,
the pane displays one item for the entire directory.
- Target Directory. Shows in which directory the content will
appear in the JAR file. You can edit this field if you want to change
the target for that particular entry. By default, entries maintain their
default package structure in the resulting JAR file.
- Target Name. Gives the item a different file name in the JAR
file. You can only set different names for individual files. If you leave
this field blank, the source file's name is used.
- In the JAR Manifest pane, specify the text for the JAR file's manifest and
click Finish. You can generate the manifest text, load it from a text file,
or type it in yourself.
The JAR recipe file appears as a
node
in the Explorer. On the node's property sheet, you can set a file filter, the
JAR file's compression level, and other attributes. See JAR
Recipe Nodes in the Explorer for more information on JAR recipe nodes.
To create a JAR file from a JAR recipe:
When the JAR file is created, the JAR recipe's
node
is replaced with a
node.
You can copy and paste the
node
to put a copy of the created JAR file in another directory.
To view the contents of the JAR file as a filesystem:
- Right-click the JAR recipe file in the Explorer and choose Mount JAR.
A
filesystem node for the JAR
file appears in the Explorer.
If you later change the JAR recipe file and rebuild the JAR, the mounted JAR file is no longer up to date. Unmount the JAR file and then remount it to display the current JAR file.
Legal Notices