Syntax highlighting broken on correct code
Answered
Here's my code. For both String and System, there's a "Cannot Resolve [token] error." Furthermore, there's a lack of a Run button:
If I use the Command Line App template, it runs:
However, IntellIJ is still throwing the same errors.
Here's my log files: https://drive.google.com/file/d/1KrIVzyVukmZTuoF3ag8AkJT2QJ6Mz5xw/view?usp=sharing
Please sign in to leave a comment.
Please try File | Invalidate Caches | Invalidate and Restart.
Also try to remove and add JDK again: https://stackoverflow.com/a/61180376/104891.
Okay, I've invalidated and restarted IntellIJ, and replaced the JDK. I'm still getting the same errors, though.
Close IntelliJ IDEA and delete the System directory: https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#system-directory.
Okay. I've deleted the System directory, but it did not fix it. I also went ahead and tried reinstalling IntelliJ altogether, and that did not seem to resolve the issue either.
How does JDK classpath tab look for you?
Do you see this JDK under External Libraries node of the Project View? Can you browse the JDK classes there?
Can you browse the JDK classes like this?
Here's what the JDK looks like for me:
I can indeed browse the JDK classes there: 
What about the IDE Project View | External Libraries node? Please show the screenshot of the JDK classes there.
Ah, I see your other screenshot now.
It appears that I can view the JDK classes in IntelliJ:
This issue's particularly strange because code does seem to compile as long as we start out in a template, which I'd presume because the Run button appears by default. It's like IntellIJ itself can't parse what I'm writing: either to display the Run button even if I write a correct Main method signature or to otherwise recognize that I'm using content from the JDK.
It's some cache/index issue. Not sure why invalidating caches doesn't help.
Try https://www.jetbrains.com/idea/nextversion/.
Try a different JDK version/vendor.