Search code examples
javaintellij-idea

Why are my classes marked in red in IntelliJ IDEA


I have some Java classes which are marked in red in project view, but IntelliJ IDEA shows no errors and it can run properly. What can be the problem?

screenshot


Solution

  • It means that the files exist locally, but are not in the repository, and are not scheduled for addition. With other words, the files are not under version control. There is not really a problem since the files can just be added to the VCS if desired. This can be done using Add to VCS from the context menu or the shortcut ⌥⌘A (Mac) or Ctrl+Alt+A (Windows).

    See File Status Highlights in the official documentation of IntelliJ IDEA for other colours and their respective meaning. See Manage files under version control for how to put the files under version control.