IntellJ IDEA "cannot resolve symbol" and "cannot resolve method",

What are the common reasons IntelliJ IDEA fails to allow JVM built-in types and methods? For example, when the mouse is over a String , a tooltip says β€œCannot resolve the character to a String.” As if IntelliJ did not know where the JVM was.

By the way, I am running OS X 10.6.6. Everything worked fine until I started the system update this morning.

+54
intellij-idea
Jan 6 '11 at 19:13
source share
3 answers

Most likely, the JDK configuration is invalid, try deleting and adding the JDK again, as I described in the corresponding question here.

+62
Jan 06 '11 at 19:20
source share
β€” -

First check that the JDK is configured correctly:

  • Go to File-> Project Structure β†’ SDK
  • Your JDK home path should look something like this: /Library/Java/JavaVirtualMachine/jdk.1.7.0_79.jdk/Contents/Home
  • Click Apply and then OK

Secondly, check if you provided the path in the "Library" section

  • Go to File-> Project Structure β†’ Libraries
  • Press the + button.
  • Add path to src folder
  • Click Apply and then OK

This should solve the problem.

+22
Sep 28 '15 at 3:03
source share

For me, IntelliJ can autofill packages, but it never seems to admit that actual classes are present at any level of the hierarchy. Neither re-selecting the SDK, nor re-creating the project seemed to fix it.

What the fix did was to delete the IDEA directory for each user (in my case ~/.IntelliJIdea2017.1/ ), which meant losing all my other settings ... But at least it made the problem go away.

+1
Jul 06 '17 at 2:03
source share



All Articles