Create a project from existing sources
Launch IntelliJ IDEA.
If the Welcome screen opens, click Import Project.
Otherwise, from the main menu, select.
In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.
Select the Create project from existing sources option and click Next.
Specify the name and location and select a format for the new project. It's recommended that you use the directory-based format.
If you are importing the project to the same directory, the IDE asks you whether you want to overwrite it. If you click Yes, IntelliJ IDEA will overwrite the files in .idea directory and the .iml files, your source files will remain intact.
Select the directories that you want to use as source root directories (folders with your source code) and click Next.
Select the libraries that you want to add to the new project.
You can join several selected libraries or archives into a new library by clicking or split the selected library into two by clicking .
Review module structure: select the modules that you want to include in your project.
You can merge several modules into one by clicking or split the selected module into two by clicking .
Specify the SDK that you want to use.
If the necessary SDK is already defined in IntelliJ IDEA, select it from the list on the left. Otherwise, click and add a new SDK.
Enable support for the detected frameworks and technologies: select checkboxes next to the necessary items.
You can also specify how the files-indicators should be grouped: by type (by framework) or by directory (by location).