IntelliJ error: cannot find symbol @javax.annotation.Generated

Viewed 28412

This is my first time using IntelliJ so this is probably just a basic question but alas I have it anyways.

I have cloned a github project into IntelliJ that uses gradle. I import and first thing it says is that gradle is not set up right, so I set it up according to the following: gradle prefrences Java version 14.0.1. Then it said the SDK was still not set up so I again set that up for again version even though I am not using Android.

I can successfully run a few of the grade tests but all of my java code no longer links methods and when I run the tests (directly from github without any changes yet) I get an error: cannot find symbol @javax.annotation.Generated(

Also all of the methods in my example seem to no longer link. I have a screenshot of this too.

Any guidance is appreciated, probably a problem in the set up? I found this symbol error a few times but no resolution that helped. I tried invalidating caches and restarting a few times. I deleted the .idea files a few times. tried a different repository in git and still having the same errors.

Thanks!

1 Answers

Simply add the javax annotation dependency into your build.gradle.

dependencies {
  //...
  implementation 'javax.annotation:javax.annotation-api:1.3.2' 
  //...
}

like so.

Related