Create a Java package in Eclipse

Posted in Environment Setup, Java By Raj On November 18, 2017


In my previous article, I have explained how to create Java Project using Eclipse, In this post,  I am going to showcase you how to create a java package in Eclipse, The Java Package is nothing but a logical segregation of classes, interface, enumerations etc… or a group of related items, here, I am going to create a user-defined package and the name of the package is “com.keysandstrokes.examples”, you can repeat the same steps to create other packages which are something like “com.keysandstrokes.utils” and “com.keysandstrokes.interfaces”

The java package can be created in different ways in Eclipse, you can

                                                        Go to File -> New -> Package

                                                                           ( or )

                                                       Right click on src folder and select New -> Package

                                                                            ( or )

                                                        Click on package icon in the toolbar



Once you selected package option you will see Java Package Wizard window


Enter the package name in the name text box and click on finish button, then you should see something like below


Once the package is created then you need to create a class check my other article on how to create a class using Eclipse