Eclipse is yet another popular Java IDE. If you are a current user of Eclipse and want to migrate from it to IntelliJ, then this is a good starting point.
This chapter discusses how to import Eclipse projects in IntelliJ, its terminologies equivalent to Eclipse, popular shortcuts and frequently asked questions.
In this section, we will discuss how to import an existing project. Follow these steps to import the project −
Navigate to File → New → Project from Existing Sources.
Select your NetBeans project directory.
When the Import Project wizard opens, select the Create project from existing sources option.
Follow the on-screen instructions to continue.
The following table compares IntelliJ and NetBeans terminologies −
IntelliJ | Eclipse |
---|---|
Project | Workspace |
Module | Project |
Facet | Facet |
Library | Library |
SDK | JRE |
Path variable | Classpath variable |
IntelliJ is a keyboard-centric IDE. It provides shortcuts for most of the actions. The following table lists a few popular shortcuts −
Action | Shortcut |
---|---|
Run java program | ctrl+shift+F10 |
Organize imports | ctrl+alt+o |
System.out.println() | Type sout and Press ctrj+j |
Delete current line | ctrl + y |
Search | ctrl + shift + f |
Generate getter and setter | alt + insert |
Format code | ctrl + alt + l |
Comment out code | ctrl + / |
Go to line | ctrl + g |
Go to declaration | ctrl + b |
Rename | shift+F6 |
Move lines | ctrl + shift + up/down |
The following table lists down commonly used debugger shortcuts −
Debug action | Shortcut |
---|---|
Debug a program | Shift + F9 |
Choose configuration and debug | Shift+Alt+F9 |
Step over | F8 |
Step into | F7 |
Smart step into | Shift + F7 |
Step out | Shift + F8 |
Force step over | Shift+Alt+F8 |
Force step into | Shift+Alt+F7 |
Resume program | F9 |
Evaluate expression | Alt+F8 |
Toggle breakpoints | Ctrl+F8 |
View breakpoints | Ctrl+Shift+F8 |
In this section, we will see a few Frequently Answered Questions and tips. The FAQs and tips are as follows −
While Eclipse uses its own compiler, IntelliJ IDEA uses the javac compiler bundled with the project JDK. If you want to use the Eclipse compiler −
Navigate to File → Settings → Build, Execution, Deployment → Compiler → Java Compiler.
Select the required compiler from User compiler dropdown.
For Eclipse users who prefer not to learn new shortcuts, IntelliJ IDEA provides the Eclipse keymap that closely mimics its shortcuts −
To import your Eclipse formatter settings −
Navigate to File → Settings → Editor → Code Style → Java.
Select the Eclipse XML profile.
Like Eclipse, IntelliJ does not provide visual forms for editing Maven/Gradle configuration files.
Once you have imported/created your Maven/Gradle project, you are free to edit its pom.xml/build.gradle files directly in the text editor.