Eclipse 简明教程

Eclipse - Create Java Package

Opening the New Java Package wizard

你可以使用新建 Java 包向导创建一个 Java 包。Java 包向导可以用不同的方式打开:

You can use the New Java Package wizard to create a Java package. The Java Package wizard can be opened in different ways −

  1. By clicking on the File menu and selecting New → Package.

  2. By right click in the package explorer and selecting New → Package.

  3. By clicking on the package icon which is in the tool bar( ).

如果您创建的是子软件包,请在打开 Java 软件包向导之前选择父软件包,以便 name 字段其中有默认值。

If you are creating a sub package, before opening the Java Package wizard select the parent package so that name field can have a default value in it.

Using the New Java Package Wizard

显示 Java 软件包向导后 -

Once the Java Package wizard comes up −

  1. Enter/confirm the source folder name.

  2. Enter the package name.

  3. Click on the Finish button.

new java package

Viewing the Newly Created Package

包资源管理器将在源文件夹下显示新建的软件包。

The package explorer will show the newly created package under the source folder.

new java package pe