Creating Packages and package-info Files
On this page:
Introduction
Within the folders marked as containing source code (see e.g. Folder categories), the and commands are available for creating packages and package-info files.
Creating a package
To create a package, follow these steps:
- Open the Project tool window (e.g. ).
- Select the destination folder or package (, or ).
- Do one of the following:
- Select .
- Select from the context menu.
- Press Alt+Insert and select Package.
- In the dialog that opens, specify the package name. This may be just a name (e.g.
helloworld
) or a sequence of names separated with dots (e.g.com.example.helloworld
). In the latter case, the corresponding package structure will be created.
Creating a package-info.java file
To create a package-info.java file, follow these steps:
- Open the Project tool window (e.g. ).
- Select the package for which you want to create a package-info file.
- Do one of the following:
- Select .
- Select from the context menu.
- Press Alt+Insert and select package-info.java.
Last modified: 29 November 2017