"package org.junit does not exist"

Latest IntelliJ IDEA CE.

After importing a bunch of Eclipse projects as modules, I'm getting multiple strange problems...

One is that (though it was working last Friday), after updating today from SVN, one of my modules is saying "package org.junit does not exist" for all of my tests in that module. junit.jar is in its module settings as a jar file. I have tried removing and re-adding it to no avail.

The other is that many of my modules build and run correctly, but in their sources in IDEA, any classes from external libraries are marked red saying the class does not exist. If I go into the corresponding module's settings, remove the jar file and re-add it, then those classes are found.

I am attaching the module .iml and .idea files.

Thanks in advance for any help!



Attachment(s):
idea.zip
HelpDeskServer.iml.zip
5 comments
Comment actions Permalink

Hello.

I see no junit.jar in the attached module's dependencies. Can you show the original Eclipse .classpath that has been imported?

Thank you,
Alexander.

0
Comment actions Permalink

Thanks for the quick response.

Hmmm it's there - fourth <libelement> from the bottom:

...
          <libelement value="file://$MODULE_DIR$/../lib/junit.jar" />
...

PFA the original .classpath file (note that I may have tweaked it a bit).



Attachment(s):
.classpath.zip
0
Comment actions Permalink

So, you're looking into the iml file? To my knowledge EclipseModuleManager component data do not define module dependencies. It should be an orderEntry in NewModuleRootManager.

To check it directly, please open Project Structure dialog, Modules section, select a problematic module, Dependencies tab. It should contain a library or jar containing requires classes.

I will check with the attached .classpath, why the entry has not been created.

Regards,
Alexander.

0
Comment actions Permalink

Regarding import: seems to be known limitation.

Am I correct that your Eclipse workspace structure is like:
.../workspace-dir/project-in-question/...
.../workspace-dir/lib/jmockit/junit.jar
.../workspace-dir/(etc)
?

The limitation is that if you import only project-in-question, then references to other Eclipse projects (like /lib/...) stays unresolved, even if you later import them in addition.

This should not be a problem, if you import both Eclipse projects at once. Then the reference is created correctly.

Regards,
Alexander.

0
Comment actions Permalink

Thanks, this explains quite a bit (and would be helpful information in a "known issues" section or something). Re-creating the project and re-importing the modules all at once has fixed the issue.

0

Please sign in to leave a comment.