Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA "cannot resolve symbol" and "cannot resolve method"

What are common causes for IntelliJ IDEA not being able to resolve built-in JVM types and methods? For example, when I mouse over String the tooltip says "Cannot resolve symbol 'String'". It's as if IntelliJ has doesn't know where the JVM is.

By the way, I am running OS X 10.6.6. Everything was working fine until I ran the system update this morning.

like image 860
Landon Kuhn Avatar asked Jan 06 '11 19:01

Landon Kuhn


People also ask

What does Cannot resolve symbol mean?

“cannot resolve symbol” means that the Java compiler cannot locate a symbol referenced in your Java source code. The causes for this common error include: A missing class file. A faulty CLASSPATH.

Why does IntelliJ show red lines?

Check that you have a proper JVM SDK setting in IntelliJ Properties. If invalidate-cache-and-restart isn't enough, check that your are using the proper JVM SDK, such as Java 1.7. If you've made a change, then it's probably best to re-run Invalidate Cache & Restart. Show activity on this post.


1 Answers

Most likely JDK configuration is not valid, try to remove and add the JDK again as I've described in the related question here.

like image 91
CrazyCoder Avatar answered Sep 20 '22 18:09

CrazyCoder