Eclipse Creating Java Package
Once we create a Java Project in Eclipse, we might want to create a java package in Eclipse IDE. It can be achieved using the three ways -
Eclipse Creating Java Package
We can create the Java Project using the following 3 different ways -
- By clicking on the File menu and choosing New > Package
- By right clicking anywhere in the Project Explorer and selecting New > Package
- By clicking on the New button (
) in the Tool bar and selecting Package
Steps to create Package
Right click on the package explorer in the Eclipse Workspace and then select the package option
Once you select the package option then you will be prompted with the below screen
You need to name your Java package which should not contain the space or dot at the last. Otherwise it will provide you following error message - Invalid package name. A package name cannot start or end with a dot
Once we create package then we can see it inside the package explorer like this -