Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA 12 not resolving classes in same package, works in Eclipse

I'm using IntelliJ IDEA 12 Ultimate for the trial period and came across a bit of a weird issue. While going through the code for a recent tutoring job, I had the screenshot below after trying to compile a class:

enter image description here

The error output is after pressing Ctrl-Shift-F9 to compile the class DrawCircleLab8. As you can see, DrawingPanel is indeed in package lab8 and there are no errors until the compile time exception.

When I imported the exact same project structure in Eclipse, I was able to compile and run without a problem.

Changing the SDK from 1.7 to 1.6 had no effect. How can I resolve this issue for IntelliJ?

like image 621
Jason Avatar asked Nov 13 '13 20:11

Jason


Video Answer


1 Answers

  1. Try removing import statement for this class and then adding it once again.

  2. From your screenshot I assume that src is already marked as a source root, but to be sure you can do this once again:

    • right-click src in the Project Tree
    • select Mark as... -> Source root
  3. If the above won't work, try to compile whole project first. Compiling only one class may not work if you had never compiled the rest of the project before.

like image 197
Michał Rybak Avatar answered Nov 15 '22 04:11

Michał Rybak