Vitaliy
Vitaliy

Reputation: 8206

Intellij stopped detecting .java files

This is the first time something like that happens to me. At some point, Intellij stopped showing .java files. It stil lshows the package structure. But no .java files there. If I try to drag a file from the explorer, It opens it with this message:

// IntelliJ API Decompiler stub source generated from a class file Implementation of methods is not available

When I try to navigate to a class or file (Ctrl+N, Ctrl+Shft+N), nothing pops out. Naturally, the files are there. I tried restarting intellij, restarting the computer, reopening the project (using POM, if it matters). and running around the table a few times. Nothing helps.

Appreciate some input on how to resolve this. Can't seems to find anything like that online..

The project pane looks like this (product name is obfuscated):

enter image description here

Upvotes: 13

Views: 31419

Answers (12)

MOHK
MOHK

Reputation: 11

Go to intellij -> File -> Settings -> Maven under "Build Tools"

For "Maven home path" select "Bundled Maven"

enter image description here

Upvotes: 0

gaurav
gaurav

Reputation: 256

For me removing the .idea folder and the closing and reopening the project fixed it, I tried everything suggested above before that apart from reinstalling intellij which i feel was a bit too much to fix 1 project.

Upvotes: 3

Sandeep Shanbhag
Sandeep Shanbhag

Reputation: 83

File -> Invalidate Caches and restart worked for me.

Upvotes: 3

Jagdeep
Jagdeep

Reputation: 159

Right click on pom.xml select Maven -> Reimport do the trick.

Upvotes: 7

piotr szybicki
piotr szybicki

Reputation: 1602

Files -> Invalidate caches / Restart worked for me.

Upvotes: 7

ChenZehao
ChenZehao

Reputation: 11

In my case,My idea install plugin Java Decompiler IntelliJ Plugin . I unistall this plugin ,than it worked.

Upvotes: 0

Mohith7548
Mohith7548

Reputation: 1370

ReConfigure the project SDK. In my case it worked !

Upvotes: 1

dgupta3091
dgupta3091

Reputation: 1197

If its a maven project,

You need to re-open project by File--> New --> Project from existing sources--> pick your pom.xml . Then when the project is build and opened by idea.. then again go to File--> New --> Module from existing sources and again pick pom.xml.

This time pom.xml will be intelligent enough to get your source folders exactly the way you need.

My Idea version: 14.1.7 (must work for idea version > 12)

Upvotes: 4

Manish
Manish

Reputation: 1791

your java files may not be Context root folder.

Check Project Structure -> Modules -> Sources

Upvotes: 12

Corin Fletcher
Corin Fletcher

Reputation: 1661

Alternatively, you may want to consider reinstalling certain plugins.

All *.tpl.html files disappeared from my project window (still able to find and edit the files however). I uninstalled the AngularJS plugin and they reappeared.

Upvotes: 0

Vitaliy
Vitaliy

Reputation: 8206

Eventually reinstalled INTELLIJ and it worked out. I had to tell it to remove all previous settings though.

Upvotes: 1

user177800
user177800

Reputation:

Ok, looks like you have incorrectly set some of the directories as 'source'.

It also looks like this is a Maven project, a multi-module one at that.

They way you should load this into Intellj IDEA is through the Import Project -> Import from external model -> Maven -> pick the parentpom.xml` file and IDEA will be smart enough to load and configure all the source directories for you.

Upvotes: 3

Related Questions