Sunday, February 24, 2019

Intellij Idea - Migrating from NetBeans

NetBeans is another popular Java IDE. If you are a current user of NetBeans and want to migrate from it to IntelliJ then this will serve as a good starting point.
This chapter discusses the importing of NetBeans projects in IntelliJ, its terminologies equivalent to NetBeans, popular shortcuts and frequently asked questions.

Import NetBeans project

In this section, we will learn how to import NetBeans 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.

IntelliJ vsNetBeans terminology

The following table compares IntelliJ and NetBeans terminology −
IntelliJNetBeans
ModuleProject
Global libraryGlobal library
Module libraryProject library
Module dependencyProject dependency
Module SDKProject-specific SDK

Popular shortcuts

IntelliJ is a keyboard-centric IDE. It provides shortcuts for most of the actions. The following table lists a few important shortcuts −
ActionShortcut
Run Java programctrl+shift+F10
Organize importsctrl+alt+o
System.out.println()Type sout and press ctrl+j
Delete current linectrl + y
Searchctrl + shift + f
Generate getter and setteralt + insert
Format codectrl + alt + l
Comment out codectrl + /
Go to linectrl + g
Go to declarationctrl + b
Renameshift+F6
Move linesctrl + shift + up/down

Debugger shortcuts

The following table lists down a few important debugger shortcuts −
Debug actionShortcut
Debug a programShift + F9
Choose configuration and debugShift+Alt+F9
Step overF8
Step intoF7
Smart step intoShift + F7
Step outShift + F8
Force step overShift+Alt+F8
Force step intoShift+Alt+F7
Resume programF9
Evaluate expressionAlt+F8
Toggle breakpointsCtrl+F8
View breakpointsCtrl+Shift+F8

FAQsand Tips

In this section, we will go through a few Frequently Answered Questions and Tips. The FAQs and tips are as follows −

Can I use the NetBeans key bindings in IntelliJ IDEA?

  • Navigate to Files → Settings and select Keymap.
  • Select NetBeans from the drop down box
Drop Down Box

Is local history in IntelliJ IDEA different from that in NetBeans?

Local history in IntelliJ IDEA, generally, is more detailed. Whatever you do with a directory, file, class, method or field, or a code block is reflected in your local history. The local history also includes VCS operations.

Can I enable ‘compile on save' in IntelliJ IDEA?

  • Navigate to File → Settings → Build, Execution, Deployment → Compiler
  • Select Build Project Automatically option.
  • Click on the OK button.
Build Project Automatically

Can I use NetBeans plugins in IntelliJ IDEA?

No, you cannot.

Is it possible to build NetBeans RCP applications with IntelliJ IDEA?

It is possible; however, you will not get the same kind of support that you get with NetBeans (wizards, menu actions, etc.). For more details, visit this.

No comments:

Post a Comment

Popular Posts