IntelliJ IDEA does not show some files? Know the hiding-places

Anna Kozlova

Have you ever found yourself in a situation when there is a file that exists on the disc but IntelliJ IDEA doesn’t show it anywhere? You press synchronize but nothing happens? OK, may be the next few tips will be helpful.

  • Check “Ignored files and folders” in File | Settings | File Types:
  • Check “Excluded roots” in File | Project Structure

Your files are shown in Project View but they are missed at runtime?

  • Check compilation patterns in File | Settings | Compiler
  • Check that they were not excluded from compilation in File | Settings | Compiler | Excludes

We hope that these simple tricks will save your time as well as ours. ๐Ÿ™‚

Comments below can no longer be edited.

23 Responses to IntelliJ IDEA does not show some files? Know the hiding-places

  1. Geoffrey De Smet says:

    April 28, 2011

    The default of compilation patterns in Intellij 10 is really bad (something like *.png;*.jpg;*.properties).
    It should really be changed to “!*.java” or what you’re showing there.

  2. Martin Knoller Stocker says:

    April 28, 2011

    Can we use this to hide the intellij files like *.iml ;*.ipr or will that have a negative sideeffect?

  3. Petri Kainulainen says:

    April 28, 2011

    Thanks for your blog entry. However, the information given in this entry did not solve my problem, which is following:

    My test sources are located under a folder src/main/java/ (Yes, it is a Maven project). The sources are visible in the project view. When I try to run all tests of a project, Idea finds only two test classes and executes the tests found from them. The rest of my unit tests are ignored. I can run the tests from the ignored classes, if ran the tests by selecting only a single class and selecting ‘Run FooTest’. Maven executes all of my unit tests without problems.

    I am using IntelliJ Idea 10.0.3 and Maven 3.0.2. Any idea what could be wrong?

  4. Dmitry Kandalov says:

    April 28, 2011

    One other catch I came across is that if file extension is not registered in “File Types” it won’t be included in “Find In Path” textual search. Not obvious if you don’t know about it.

  5. asuka says:

    April 28, 2011

    Some files show but really slowly in IDEA, sometimes you need to reopen the filechooser so many times that they finally show, how do I handle it

  6. Anna Kozlova says:

    April 29, 2011

    @Petri Could you please check how created junit/testng run configuration is configured. It may be a problem with classpath where tests are searched. Thank you

  7. Mark says:

    April 29, 2011

    @Martin – I hide my .ipr, .iml, and .iws files and the .idea directory on the File | Settings | File Types screen. I find it saves hassles since searches don’t find things in settings files. And it reduces clutter in the project view. I’ve been doing it for 8 years and have never had an issue.

    My entry: …;*.ipr;*.iws;*.iml;.idea;

  8. Petri Kainulainen says:

    April 29, 2011

    @Anna, the test run configuration is following (I selected run all tests from the popup menu, which appears when I click the right mouse button on the project view):

    Test: All in package
    Search for tests: Across module dependencies
    Working directory: /Users/loke/Projects/Java/example
    Use classpath and JDK of module: example

    The rest of the fields are empty. I am running Idea on OS X 10.6.7. The weirdest thing about this problem is that it appeared between two test runs. In the first test run Idea could find all my test classes, but the second test run found only two test classes. The problem has been the same after that. Do you think that cleaning the caches of Idea could help?

  9. Anna Kozlova says:

    April 29, 2011

    @Petri Actually I do not think so. Could you please send me e-mail/contact our support/file an issue in YouTrack, as this question seems to be specific to your set up and has nothing to do with this blog entry? Thank you

  10. Petri Kainulainen says:

    April 29, 2011

    @Anna, I contacted the support team as you suggested. Thank you for your help.

  11. Ryan says:

    May 18, 2011

    It is very easy to exclude files by right-clicking and choosing exclude in the error dialog. It should be as easy to include them. Therefore, it would be very useful to have IntelliJ do two actions:

    1) When a make error occurs for a file that does exist but is included, a warning or note next to that error would be nice telling you that the compile failed due to the exclusion.

    2) Allow a user to right click on a file and exclude or include it for compilation.

  12. Andrew says:

    June 23, 2011

    Hi Anna,

    Thanks for the helpful hints.

    Where do these config files get stored? I’ve looked everywhere and Xena seems to put them somewhere that previous versions didn’t.

    I tried to log on to YouTrack, but it seems to be down.

  13. Anna Kozlova says:

    June 24, 2011

    Exclude folders are stored in corresponding .iml files; ecluded files from compilation and resource patterns are stored in compile.xml in .idea (or in .ipr file). Ignored file patterns are stored in filetypes.xml in your config directory.
    I hope that you do not need this information anyway ๐Ÿ˜‰

  14. Ryan says:

    October 13, 2011

    I would like Maven’s output dir to show in the project view so i can verify the contents of built artifacts, copy them to servers, etc. how do I get IntelliJ to stop automatically excluding the Maven output dir which is useful for development?

  15. Aydin O. Yagmur says:

    March 21, 2012

    I can see the java source file in project scope, I can compile them if there is no package scoped source file, but when switch to package view I cannot see them.

    It’s really-really annoying.

  16. Lawrence says:

    December 11, 2012

    THANKS man! It’s old thread but I was looking for a way to hide *.iml etc. Your tip is worth gold. I do not get however why IntellJ sometimes does not show these files by default and sometimes it does! Gotta be me…

    Thanks man!

  17. Noah says:

    May 25, 2013

    I’m having an odd situation where I have a project with a structure on disk like so:

    – project_root/
    – .idea/
    – module/
    – src/

    When I open the project in IDEA (13 Cardea IU-130.555) the Project Files window shows the module as a top level folder, however, the .idea directory in the project root is no present. It looks something like this:

    -> module/
    -> src/

    Is there a reason for this? How and I set things up so that the Profile Files view will include the .idea directory?



  18. Noah says:

    May 25, 2013

    It looks like I can’t edit my previous comment, but the formatting was not preserved in my last comment. The module/ and lines below it should have all been indented under -project_root/

  19. Devvyn says:

    January 28, 2016

    Hey, just an English language note (compulsive and unsolicited): “may be” doesn’t need the space. Try “maybe” instead of “may be”.

    PS: If you don’t like the word “maybe”, you can legitimize it by turning it into the phrase “this may be” in this context.

    Pedantic English editor’s explanation:

    “May be” is being used here as a adverbial phrase, yet the word “maybe” would normally be expected. If you want to get technical, the word “be” in the phrase “may be” conflicts with the other use of “be” in the phrase “will be”. (It’s impossible to apply “may be” and also “will be” to the same subject in a sentence).

  20. R says:

    May 23, 2017

    How do I make the .idea folder visible in project files?

  21. Manas Maity says:

    January 23, 2018

    I had similar problem – the maven project was imported from a Perforce workspace. a java interface was imported correctly, but after some changes, it was not showing in IntelliJ, although I could see it in Perforce workspace. Here is what worked for me: In Intellij, Right click on the folder that should contain the missing file, and I could see the file with some external change. I did revert the changes, and then it came back.

    • Manas Maity says:

      January 23, 2018

      Right click on the folder that should contain the missing file, Local History–>Show, History, and I could see the file, with some external change.


Subscribe for updates