What does this symbol mean in IntelliJ? (red circle on bottom-left corner of file name, with 'J' in it)

匿名 (未验证) 提交于 2019-12-03 08:33:39

问题:

Under the target folder in IntelliJ for a Java project I created, I have a few java source files in the package. Beside each file the 'J' icon has a red circle with a line through it.

What does that mean? How do I fix it?

回答1:

You need to specify the source dir

File> Project Structure > Modules

click the directory and click the Sources button

It's weird because usually it's done automatically. Maybe it's better if you recreate the project again.



回答2:

If it is a maven project

  1. right click on the pom.xml
  2. Add As Maven Project

Thanks



回答3:

This situation happens when the IDE looks for src folder, and it cannot find it in the path. Select the project root (F4 in windows) > Go to Modules on Side Tab > Select Sources > Select appropriate folder with source files in it> Click on the blue sources folder icon (for adding sources) > Click on Green Test Sources folder ( to add Unit test folders).



回答4:

The answer above that starts out with "you need to specify the source dir" is correct, but I don't see him telling you the easy way to do so.

Simply right click on the java sources folder ("java" under src/main/java if it is a Maven project for example) and select Mark Directory As > Sources Root (see screenshot below).



回答5:

Press F4 at the project root and select the the root source pressing the source button. It resolved my problem!

for(; ;){   makeGoodCode(); }


回答6:

Find all IntelliJ (v15) symbols over here: https://www.jetbrains.com/idea/help/symbols.html

This site states that this icon stands for "Java class located out of the source root. Refer to the section Configuring Content Roots for details."



回答7:

Another option if you're using Flavors in Android Studio:

Click Build -> Select Build Variant.

In the list click the variant you're working in and it will turn green and the others will have the red J.



回答8:

It means those files aren't part of the project settings.



回答9:

I downloaded a project from github with .idea folder. After deleting that folder, everything was ok.



回答10:

mark the java folder as source root.It will solve.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!