7

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

Matt
  • 11,360
  • 2
  • 23
  • 44
nabayram
  • 111
  • 1
  • 1
  • 6

3 Answers3

11

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.

Matt
  • 11,360
  • 2
  • 23
  • 44
3

They are not added to version control repository. Select them, and then CTRL-ALT-A ( or menu via right click ) will add them. Green means there are changes needed to commit

Konstantin Pribluda
  • 12,178
  • 1
  • 28
  • 35
0

Click File -> Synchronize, and IntelliJ should see that everything is okay again.

If that doesn't work, IntelliJ's caches might be corrupt.

Clicking File -> Invalidate Caches and restarting the IDE Src

Maleehak
  • 413
  • 3
  • 14