Eclipse 简明教程

Eclipse - Create Jar Files

Opening the Jar File wizard

可以利用 Jar 文件向导将项目的目录导出到 Jar 文件中。要打开 Jar 文件向导,请执行以下操作:

The Jar File wizard can be used to export the content of a project into a jar file. To bring up the Jar File wizard −

  1. In the Package Explorer select the items that you want to export. If you want to export all the classes and resources in the project just select the project.

  2. Click on the File menu and select Export.

  3. In the filter text box of the first page of the export wizard type in JAR.

create jar 1
  1. Under the Java category select JAR file.

  2. Click on Next.

Using the Jar File wizard

在 JAR 文件规范页面中:

In the JAR File Specification page −

  1. Enter the JAR file name and folder.

  2. The default is to export only the classes. To export the source code also, click on the Export Java source files and resources check box.

create jar 2
  1. Click on Next to change the JAR packaging options.

  2. Click on Next to change the JAR Manifest specification.

  3. Click on Finish.