2

After updating to 2019.1.3, IntelliJ (Community Edition) stopped recognizing any of the built-in java classes on my development machine. I get the following error:

Can't resolve Symbol String

Can't resolve Symbol String

I first thought the JDK was not configured properly, but it doesn't look like so:

enter image description here

I can see all the java base classes, including java.lang.String, under the "External dependencies" panel in IntelliJ :

enter image description here

I tried to reinstall the JDK, without any success:

sudo apt-get --purge remove openjdk-11-jdk
sudo apt-get install openjdk-11-jdk

I also invalidated caches and restarted IntelliJ, also unsuccessfully.

Compilation from the command line works fine.

lovasoa
  • 6,419
  • 1
  • 35
  • 45
  • Which IntelliJ version you are using? – Youcef LAIDANI Jun 09 '19 at 20:02
  • I am using IntelliJ IDEA 2019.1.3 (Community Edition) Build #IC-191.7479.19, built on May 28, 2019 JRE: 1.8.0_202-release-1483-b58 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.15.0-51-generic I will add this information to the question. – lovasoa Jun 09 '19 at 20:05
  • It seems this pose here has the same issue https://askubuntu.com/questions/1101033/in-intellij-from-snap-i-cant-select-openjdk-11-from-apt-get – Youcef LAIDANI Jun 09 '19 at 20:10
  • Unfortunately, it looks like no one found a solution to the question you link. One answer is about someone who did not use the right path to the jdk, another is the OP saying he switched to oracle's JDK. – lovasoa Jun 09 '19 at 20:17
  • Not sure if related, would be odd if 11 as the same issue: https://stackoverflow.com/questions/47296429/properly-set-up-java-9-as-sdk-in-intellij-idea-on-linux-due-to-new-folder-struct/47850159#47850159 – Taji Jun 09 '19 at 20:50
  • Have you tried ti remove SDK in IDEA and re-add it? – y.bedrov Jun 10 '19 at 10:01
  • Yes, I tried to remove the SDK and re-add it. I also tried OpenJDK 8 and Oracle's JDK 12. Always the same result. I am going to try and delete IntelliJ and reinstall it. – lovasoa Jun 10 '19 at 20:20
  • Don't forget to clean directories used to store setting/configs: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs – y.bedrov Jun 11 '19 at 10:18

2 Answers2

3

I had the same problem with Ubuntu 19.10 and could solved as follows:

Intellij IDEA

File -> Project Structure -> SDK ->

JDK home path: /usr/lib/jvm/default-java

Hope it will help someone.

DJDJ
  • 31
  • 2
1

I updated my plugins within IntelliJ which caused IntelliJ to reindex again.

Apparently, that did the trick and it is working fine now for me.

GhostCat
  • 137,827
  • 25
  • 176
  • 248
  • 2
    Note that there is also an "invalidate caches and restart" action in the File menu, that sometimes achieves wonders. – GhostCat Jun 18 '19 at 12:59