Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cannot resolve symbol" in Intellij IDEA

I am unable to use libraries from one "module" in another. I am seeing red class names and getting "Cannot resolve symbol ..." errors all over the place:

enter image description here

The other modules are referenced in File | Project Structure all the other module's Paths are correct and include the *.classes I'm trying to use:

enter image description here

I have also tried a File | Invalidate Caches but am still having the same problems.

What do I need to do to fix this?

like image 323
Mark Williams Avatar asked Jan 21 '26 02:01

Mark Williams


1 Answers

Listed below are steps which may fix the problem:

1.Invalidate and refresh the IntelliJ's caches

File Menu -> Invalidate Caches / Restart -> Invalidate and restart

2.Project SDK selection

Check project settings from File Menu -> Project Structure Ensure an SDK is selected for the Project SDK. If is selected, click the 'New' button, select JDK and then select the correct path to the JDK e.g. /opt/java/jdk1.8 or c:\Java\Jdk1.8

3.Corrupt JDK

There may be a problem with your JDK installation, re-install JDK

4.Re-import the project

Close the project if it is open in IntelliJ Delete the .idea folder in the project source code folder. Start IntelliJ and Import the project.

You can choose any of them which will work for you.

like image 130
Dipesh Yadav Avatar answered Jan 22 '26 15:01

Dipesh Yadav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!