"Cannot resolve symbol" errors after replacing jar outside idea 7.0M2.

I use maven to regenerate jars. If I make a change to one project and then do an "mvn install" it'll update the jar file in the local repository. If another idea project makes use of that jar then the editor will now be filled with "Cannot resolve symbol" errors.

Note that that other project will build just fine. I can do a clean rebuild and any changes I've made to the first project will be usable and everything works fine when running the application.

But, the editor is filled with "Cannot resolve symbol" errors. It's a sea of red underlines for every class which was defined in that jar.

I cannot consistently figure out how to get rid of these errors. Some combination of the following seems to do it, but I don't know exactly which has the effect:
- remove the jar from the dependencies then compile then add it back to the dependencies.
- delete target directories
- delete the system directory of idea in the documents and settings
- do a complete rebuild
- rebuild the idea project files.
- exiting idea entirely (not just closing the project)
I'm hoping someone can tell me specifically what I need to do to fix this simply. It's tiring to randomly do those things until these errors finally go away (I have to do this every time I regenerate the jar file).

5 comments

Hello Geoff,

This problem should be fixed in IntelliJ IDEA 7.0 Release Candidate:
http://www.jetbrains.net/confluence/display/IDEADEV/Selena+EAP

I use maven to regenerate jars. If I make a change to one project and
then do an "mvn install" it'll update the jar file in the local
repository. If another idea project makes use of that jar then the
editor will now be filled with "Cannot resolve symbol" errors.

Note that that other project will build just fine. I can do a clean
rebuild and any changes I've made to the first project will be usable
and everything works fine when running the application.

But, the editor is filled with "Cannot resolve symbol" errors. It's a
sea of red underlines for every class which was defined in that jar.

I cannot consistently figure out how to get rid of these errors. Some
combination of the following seems to do it, but I don't know exactly
which has the effect:
- remove the jar from the dependencies then compile then add it
back to the dependencies.
- delete target directories
- delete the system directory of idea in the documents and
settings
- do a complete rebuild
- rebuild the idea project files.
- exiting idea entirely (not just closing the project)
I'm hoping someone can tell me specifically what I need to do to fix
this simply. It's tiring to randomly do those things until these
errors finally go away (I have to do this every time I regenerate the
jar file).

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Is this the same issue?
http://www.jetbrains.net/jira/browse/IDEA-15542

Dmitry Jemerov wrote:

Hello Geoff,

This problem should be fixed in IntelliJ IDEA 7.0 Release Candidate:
http://www.jetbrains.net/confluence/display/IDEADEV/Selena+EAP

>> I use maven to regenerate jars. If I make a change to one project and
>> then do an "mvn install" it'll update the jar file in the local
>> repository. If another idea project makes use of that jar then the
>> editor will now be filled with "Cannot resolve symbol" errors.
>>
>> Note that that other project will build just fine. I can do a clean
>> rebuild and any changes I've made to the first project will be usable
>> and everything works fine when running the application.
>>
>> But, the editor is filled with "Cannot resolve symbol" errors. It's a
>> sea of red underlines for every class which was defined in that jar.
>>
>> I cannot consistently figure out how to get rid of these errors. Some
>> combination of the following seems to do it, but I don't know exactly
>> which has the effect:
>> - remove the jar from the dependencies then compile then add it
>> back to the dependencies.
>> - delete target directories
>> - delete the system directory of idea in the documents and
>> settings
>> - do a complete rebuild
>> - rebuild the idea project files.
>> - exiting idea entirely (not just closing the project)
>> I'm hoping someone can tell me specifically what I need to do to fix
>> this simply. It's tiring to randomly do those things until these
>> errors finally go away (I have to do this every time I regenerate the
>> jar file).

0

The fix originally seemed to work, but now I'm getting a very similar bug which I can't fix at all.

I upgraded to 7.0R6 and now to 7.0. I haven't seen a reoccurrance of the superfluous red lines in the editor due to jar updates, but right now I have an error in the editor where it says "Cannot resolve symbol" for a class that exists in the same package and same directory in the same project.

In particular, the class com.ign.pxed.editInstance.client.EditInstance is unable to see (in the editor) the class com.ign.pxed.editInstance.client.EditSelfContainedInstance

It builds and runs fine. I tried deleting the system directory, the target directories, and doing a full rebuild. Nothing has fixed the issue. I haven't tried recreating the project files yet.

0

That looks similar, but that issue was about tags in xhtmls files while my problem is with java files. Also, deleting the system directory isn't fixing my current problem.

0

Please sign in to leave a comment.