xSk37chx
xSk37chx

Reputation: 75

Cannot resolve symbol in Git repo files with IntelliJ

I've been working on getting set up using GitHub for a Java project using IntelliJ. I've figured out the basics of using GitHub but for some reason after I've got a repository set up, clone the project and open it in IntelliJ it has errors recognizing every single class type.

The src files open fine, run fine, compile fine yet IntelliJ highlights every single statement with a type declaration in it, like "Cannot resolve symbol", and says that it does not recognize the type. Yet all src files are in the same folder.

intellij showing type errors

Upvotes: 0

Views: 4670

Answers (1)

random
random

Reputation: 9955

IntelliJ is not recognising those files as proper source code because it wasn't told to. You will need to mark the folder as source root.

  1. Right-click on folder
  2. Select Mark Directory AsSource Root

mark directory in intellij

Upvotes: 2

Related Questions