Ced
Ced

Reputation: 17327

IntelliJ is acting cray cray with imports

After moving files in and out because I wasn't sure of the structure IntelliJ is just going absolutly mental on me:

My class is situated in main.java.entities.FailedAttempt

Scenario 1

import main.entities.FailedAttempt; 

Here it says entities is not found (which is correct) yet it finds the class

Scenario 2

import main.java.entities.FailedAttempt; 

Here it finds the import of entities (it should not) but doesn't find the class!

Scenario 3

import main.java.entities.*; 
...
private List<FailedAttempt> faList = new ArrayList<FailedAttempt>();

Here the import is correct - no error message - but it's unused and private List<FailedAttempt> cannot be resolved.


What I did:

The package was originally named main.java which contained a bunch of other packages. I renamed it to main, then created another java package in it and put all the other class in that java package. Resulting in exactly what I had at the beggining.. Except for the imports which are totally messed up.

Can I somehow resolve this ? I've a feeling I'll have to manually change the class names, invalidate cache, delete project and reimport the folder into intelliJ. But if there is a better method I'm all for it.

I created an issue on their tracker

Upvotes: 0

Views: 35

Answers (2)

Ced
Ced

Reputation: 17327

Had to close the project, Import a new project from an earlier git version and work from there. If someone has this in the future and doesn't use cvs I think it's gonna be annoying.

Upvotes: 0

El Hoss
El Hoss

Reputation: 3832

Use this icon:

enter image description here

to open the project structure and set it up structure using Project Settings -> Modules under Sources:

enter image description here

Last, you should check, that everything is exported. You can do that under Artifacts.

Hope that helps.

Upvotes: 1

Related Questions