Open a Java perspective, select the menu item File > New > Project.... to open the New Project wizard.
Select Java project in the list of wizards and click Next.
On the next page, type "MyProject" in the Project name field.
In Project layout group, change selection to Create separate source and output folders and edit Configure default... to modify Source folder name from "src" to "sources".
Edit project "MyProject"properties and select Java Builder Path page.
On Source tab, click Add Folder....
On Source Folder Selection click Create New Folder....
In New Folder dialog, type "tests" in the Folder name field.
Your project setup now looks as follows:
Click OK
sources
and a tests
folders. You can start adding classes
to these folders or you can copy them using drag and drop.
Working with build paths
Creating a new Java project
Creating a Java project with source folders
Creating a new source folder
Using the Package Explorer