60
votes

Every once in a while, I open an old project and I can't see any of the folders in the intelliJ project viewer. I can see all the files at the root.. but no folders. Yes I can delete the .iml file and .idea folder and re-create the project, but come on.. there's gotta be an easier way to fix this.

Is there?

9
If you look in project settings (ctrl-shift-alt-s), can you see a module structure? And what verison of intellij are you using, 12 or 14?vikingsteve
I'm using version 12, under Modules there is "Nothing to show"B T
Heyyy, and checking my other projects, there is stuff to show in those. I added my root folder as a web module, it complained about the name already existing and I judiciously ignored that warning and pressed OK. Now my folders are back! Thanks!B T

9 Answers

87
votes

If you look in project settings (ctrl-shift-alt-s), you should see a module structure. If you instead see "Nothing to see", do the following:

  1. In Project Structure -> Modules, press the + button,
  2. press enter (since, for some weird reason, it won't let me click on "New Module")
  3. In the window that pops up, click on the "..." next to Content root, find your root folder, and select it
  4. Press ok
  5. ignore any warning that says the name is already in use (or to that effect)
64
votes

the simplest solution worked from me, just delete the .idea folder

keep in mind this will delete all of idea's current project configuration, it'll create the folder with default settings when reload the project again... but all other configuration will be lost if not properly backed-up

35
votes

It might be because the project didn't have any modules defined. Try adding existing source code by hitting File > New > Module from Existing Sources and select the parent directory of the project for source code

Module from existing sources

8
votes

Go to pom.xml file -> right click -> maven -> generate source and update folders. You will see your files and folder structures in left hand side.

3
votes

All the project-specific settings for a project opened through Intellij IDE are stored in the .idea folder.

The .idea folder (hidden on OS X) in the solution root contains IntelliJ’s project-specific settings files. These include per-project details such as VCS mapping and run and debug configurations, as well as per-user details, such as currently open files, navigation history and currently selected configuration.

So, if you are not able to see the project file structure in your Intellij IDE, just delete the .idea folder,

rm -rf .idea

and reload the project, then after reload you'll be easily able to get your project structure displayed.

0
votes

For me, the java folder was not showing up. I went into File->Project Structure. In the second column, I selected on _main. In the third column, I selected the tab "sources". In what I call the fourth column, where the "+Add Content Root" is shown, I verified, the java source/folder was present. In my case, there was an extra source folder, which was the current location. I removed this, applied and the java folder immediately showed up.

0
votes

Right click on the Project name -> Open Module Setting -> Check the application context path set it up at your project location.

0
votes

Check your idea.log -- it may have some details explaining why or what is happening (Help | Reveal log in Explorer). Possibly one of the config files got corrupted.

You can always backup and delete .idea subfolder (project settings) and re-create project from scratch. When it's wroking again (after basic configuration) you may copy some of the files from that folder back to recover some of your settings (if there were many).

0
votes

This happened to me on a new computer when I opened up a Java project in the newly installed Intellij.

The problem was that I had not installed any JDK on the machine.

I had to install a JDK and then go into the settings at ctrl-shift-alt-s and add a JDK by specifying the folder where I installed it. It's possible that IntelliJ would have found it if I closed it and reopened it.