IntelliJ IDEA 13.1 Web Help

To fix unresolved reference in a Java class
  1. In a Java class, place the caret at an unresolved reference, and press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1.
  2. From the suggestion list, choose Add Maven Dependency

    maven_references1.png

    The Maven Artifact Search dialog box opens with the Search for class tab having the focus, and with the reference in question as the search string.

  3. Select the desired dependency, and click Add. IntelliJ IDEA downloads the necessary libraries and rebuilds indices, and adds the corresponding <dependency> element to the pom.xml file. Import assistant pop-up window appears at the unresolved reference:

    maven_references.png

  4. Press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1 to apply import assistance.

See Also

Concepts:

Procedures:

Web Resources: