Previous | Top | Next |
IntelliJ IDEA allows you to import projects from Eclipse in two ways. If you do not need backwards compatibility, you typically instruct IntelliJ IDEA to create a new set of native project files. Otherwise, you can instruct IntelliJ IDEA to keep project files in sync so that you can work on the project from both environments.
1. Choose the Project to Import
Click Import Projectfrom the Quick Start window or select the File → Import Project ...menu item. Next, select the .classpath file or .project file to import and confirm.
A dialog box displays asking you to finalize the import of the project.
2. Choose the Type of Project to Import
IntelliJ IDEA can import projects in a variety of formats, including Eclipse, Maven, and Gradle. If IntelliJ IDEA cannot automatically recognize the format of the selected project, it asks you to indicate this:
3. Specify the name and location of the new project
Indicate the directory where the Eclipse projects can be found. Also, specify additional parameters such as where to create IntelliJ IDEA project files.
4. Specify the location of the project files to be created
You have two ways to indicate the location of the IntelliJ IDEA project files to be created. By default, IntelliJ IDEA suggests that you keep project files in the same Eclipse source directory. By clicking the ellipsis button, however, you can navigate to a different location. Choosing a different folder is ideal as it will not affect the Eclipse project in any way, and Eclipse users will not see IntelliJ IDEA project files.
As an alternative, you can instruct IntelliJ IDEA to create a module file per each Eclipse project found, as specified in the .classpath file. The .classpath file indicates the list of the projects found in the directory.
5. Specify the desired format of the IntelliJ IDEA project file
Choose the format of the files for the IntelliJ IDEA project. The two possible options include the directory-based format (.idea, default) and the file-based format (.ipr).
6. Choose whether to keep IntelliJ IDEA and Eclipse Projects in Sync
The checkbox Link created IntelliJ IDEA modules to Eclipse project files automatically keeps the Eclipse projects and IntelliJ IDEA modules synchronized. By choosing this option, you enable a more collaborative scenario and ensure that your project can be opened and used at any time from both Eclipse and IntelliJ IDEA.
If you choose to keep projects in sync, then IntelliJ IDEA will store any project model information right in the .classpath files. This way, all changes made to the project structure (e.g. new libraries or a change in the source root) are propagated to Eclipse users as well. Likewise, any changes made to the project from within Eclipse will be applied to the IDEA project model on VCS updates.
If IntelliJ IDEA fails to store some options in the .classpath files, it will create an .eml file to track such changes. This means, of course, that these options won't be propagated to Eclipse users.
7. Choose the project to import
Next, choose the particular projects in the selected Eclipse workspace that you want to import into the new IntelliJ IDEA project.
8. Select the Java SDK and Android SDK
Choose the Java SDK and Android SDK that all modules will use by default.
As a result, you now have a fully IntelliJ-IDEA-enabled project built on top of your existing Eclipse project.
Previous | Top | Next |