IntelliJ IDEA 15.0 Help


NetBeans users ask the following question about IntelliJ IDEA most frequently:


How do I open a NetBeans project in IntelliJ IDEA?

Use File | New | Project from Existing Sources and select your NetBeans project directory.

When the Import Project wizard opens, select the Create project from existing sources option and then follow the instructions of the wizard.

IntelliJ IDEA will add the necessary definition files (the .idea directory) to your project directory. The NetBeans .nbproject directory and build.xml will remain untouched, and you'll be able to use IntelliJ IDEA along with NetBeans.

During the import IntelliJ IDEA will fix missing libraries, add facets for different Web frameworks and create a run configuration.

If you are using Maven with NetBeans and you want to import a Maven project into IntelliJ IDEA, select File | Open and then select your project's pom.xml. You'll still need to configure a run configuration, however, all project dependencies will get resolved.

See also, Creating a Project by Importing Existing Sources.

What's the difference between projects and modules?

IntelliJ IDEA creates a project for an entire code base and a module for each of its individual components. So, IntelliJ IDEA module is more like a NetBeans project.

The following table maps the most important NetBeans concepts to IntelliJ IDEA ones.

NetBeans IntelliJ IDEA
Project Module
Global library Global library
Project library Module library
Project dependency Module dependency

Is there a directory-based project format in IntelliJ IDEA?

Yes, there is a .idea directory where project definition XML files are stored. For more information, see Project.

How do I change the JDK for my project?

  1. Open the Project Structure dialog (File | Project Structure or Ctrl+Shift+Alt+S).
  2. Under Platform Settings, select SDKs.
  3. Click add, select JDK and specify the JDK installation directory.
  4. Click Apply.
  5. Under Project Settings, select Project.
  6. Under Project SDK, select the JDK from the list.
  7. Click OK.

For more information, see Configuring Global, Project and Module SDKs.

How do I add a library to my project?

  1. Open the Project Structure dialog (File | Project Structure or Ctrl+Shift+Alt+S).
  2. Under Project Settings, select Libraries.
  3. Click add, select Java and specify the library location.
  4. Select the modules in which this library will be used.
  5. Click OK.

For more information, see Configuring Project and Global Libraries and Configuring Module Dependencies and Libraries.

How do I configure a Web framework for my project?

In IntelliJ IDEA Ultimate (there's no corresponding functionality in the Community Edition):

  1. Open the Project tool window (e.g. View | Tool Windows | Project).
  2. Right-click the necessary module and select Add Framework Support. (Framework support is enabled at a module level.)
  3. In the Add Frameworks Support dialog that opens, select the frameworks to be supported, specify the associated settings and click OK.

For more information, see Add Frameworks Support Dialog and e.g. Enabling JSF support for an existing module.

The Run button is disabled. How do I run my application?

The Run button is disabled because there are no run configurations in your project.

If you have a Java class with a main() method, open the corresponding file in the editor, right-click the editing area and select Run '<FileName>.main()'. As a result, the necessary run configuration will be created automatically and then executed.

You can also create run configurations yourself: e.g. Run | Edit Configurations | add, etc.

How do I generate an Ant build script for my project?

Select Build | Generate Ant Build. For more information, see Generating Ant Build File.

Where is the Options dialog?

In IntelliJ IDEA, the Settings dialog is used for similar purposes. To open this dialog, press Ctrl+Alt+S.

There is also the Project Structure dialog (Ctrl+Shift+Alt+S) which lets you manage JDKs, libraries, module dependencies, etc.

For more information, see Settings / Preferences Dialog and Project Structure Dialog.

How do I close a project?

Select File | Close Project. You can also use File | Exit to close all open projects and quit IntelliJ IDEA. See also, Opening, Reopening and Closing Projects.


Can I use the NetBeans key bindings in IntelliJ IDEA?

Yes, you can.

  1. Open the Settings dialog (e.g. Ctrl+Alt+S).
  2. In the Appearance and Behavior category, select Keymap.
  3. In the right-hand part of the dialog, next to Keymaps, select NetBeans 6.5 from the list.
  4. Click OK.

How does code completion in IntelliJ IDEA work?

The code completion suggestion list appears automatically after you type one or two letters. To narrow down this list, use:

  • Ctrl+Space. The list is reduced to keywords and also the names of classes, methods and fields available in the current context. Note that the list changes when you press Ctrl+Space for the second or third time.
  • Ctrl+Shift+Space. Only the types appropriate for the current context are shown.

For more information, see Auto-Completing Code.

Is local history in IntelliJ IDEA any 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.

For more information, see Using Local History.

Are there any special code analysis features in IntelliJ IDEA?

IntelliJ IDEA can analyze dependencies, data flows and stacktraces, find duplicates and evaluate code quality. Just have a look at the options in the Analyze menu.

For more information, see Analyzing Applications and Code Inspection.

Can I enable 'mark occurrences' in IntelliJ IDEA?

You can. The corresponding option in IntelliJ IDEA is called Highlight usages of element at caret. This option is enabled by default.

Just in case:

  1. Open the Settings dialog (e.g. Ctrl+Alt+S).
  2. In the Editor category, select General.
  3. In the right-hand part of the dialog, under Highlight on Caret Movement, select the Highlight usages of element at caret check box.
  4. Click OK.

See also, Highlighting Usages.

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

You can.

To enable automatic compilation on every save (or autosave), turn on the Make project automatically option in the Settings dialog:

  1. Open the Settings dialog (e.g. Ctrl+Alt+S).
  2. In the Build, Execution, Deployment category, select Compiler.
  3. In the right-hand part of the dialog, select the Make project automatically check box.
  4. Click OK.

Also note that by default, IntelliJ IDEA saves changed files automatically, so you don't need to use Ctrl+S as frequently as in other IDEs.

Can I enable 'deploy on save' in IntelliJ IDEA?

There is no such option in IntelliJ IDEA settings, however, you can get similar result by choosing an appropriate application update option in the corresponding run configuration.

For more information, see Updating Applications on Application Servers.

(The corresponding functionality is available only in IntelliJ IDEA Ultimate. The Community Edition doesn't provide integration with application servers.)


Can I use NetBeans plugins in IntelliJ IDEA?

Unfortunately not. However, a lot of functionality implemented as plugins for NetBeans is available in IntelliJ IDEA "out of the box". Besides, there's a lot of plugins for IntelliJ IDEA, so you can always find an IntelliJ IDEA plugin with the functionality similar to that of your favorite NetBeans plugin.

How do I find the plugin that I need?

All the functions related to working with plugins are on the Plugins page of the Settings dialog (Ctrl+Alt+S | Plugins). You can look for, download, install and update the plugins as well as enable and disable them.

For more information, see Plugins and Managing Plugins.

How do I install the plugin that I have available on my computer?

  1. Open the Settings dialog (e.g. Ctrl+Alt+S).
  2. In the left-hand pane, select Plugins.
  3. In the lower part of the Plugins page, click Install plugin from disk.
  4. In the dialog that opens, select the plugin file (normally, a JAR or ZIP).
  5. Click OK.
  6. If asked, restart IntelliJ IDEA.

I'd like to write a plugin for IntelliJ IDEA. Are there any instructions?

Yes, have a look at:

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

It is possible, however you won't get the same kind of support you would in the case of NetBeans (wizards, menu actions, etc.). Have a look at Using IntelliJ IDEA for NetBeans Platform Development.

Last modified: 5 November 2015