1

I have Intellij Idea community Edition and I am programming in Scala.

My @Entity annotations are highlighted with the message "Cannot resolve symbol."

I looked at this question IntelliJ IDEA highlights @Entity class names with "Cannot resolve symbol" in JP QL, which has the same issue. The answer there says that I should install the JPA plugin for Intellij.

I looked here: https://www.jetbrains.com/idea/help/enabling-jpa-support.html However, when I search for a plugin called JPA or Java EE in Intellij I can not find anything.

Any idea about why this is happening? Am I not searching for the correct plugin?

1

1 Answer 1

0

For IDEA to resolve the symbols, you need to add the relevant dependency in the same way you'd add any other dependency. Either (the better option) to your build system (SBT, Gradle, or Maven) or directly to the IDEA project if you don't use any of those:

Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
In the left-hand pane of the dialog, select Modules.
In the pane to the right, select the module of interest.
In the right-hand part of the dialog, on the Module page, select the Dependencies tab.
On the Dependencies tab, click add and select Library.
In the Choose Libraries dialog, click New Library.
If suggested, select:
    Java to create a Java library. Select the files and folders to be included in the library in the dialog that opens.
    From Maven to download a Java library from a public Maven repository. Specify the artifact to be downloaded and the associated settings in the Download Library from Maven Repository dialog.
In the Configure Library dialog:
    Specify the library name.
    Select the library level (global, project or module).
    Configure the library contents using add, iconLibExclude and delete.
    Click OK.
In the Choose Libraries dialog, click Add Selected.
If necessary, select the Export option and change the dependency scope.
Click OK in the Project Structure dialog. 

Of course, this won't give you any special JPA support. In particular, the linked question is talking about errors shown in JPQL strings, not on the annotations themselves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.