Search code examples
javaintellij-ideaplayframework-2.4

Play 2.4 and IntelliJ not resolving classes


I'm starting up my first Play 2.4 project and I'm having an issue with IntelliJ recognizing and finding the JUnit and Play test classes. Here is a screenshot of what I see

Issue

So basically, the code intelligence isn't picking up the JUnit dependency. The test appears to run fine when I run activator test.

Questions: What can I do to get code intelligence to pick these up Do I need to mark specific directories as sources?

I have restarted intellij, and rebuilt using sbt.


Solution

  • Take a look at this answer: https://stackoverflow.com/a/19343428/1066240

    All you need (after valid project import) is step no. 4:

    1. Click the red @Test annotation, hit Alt + Enter and choose Add junit.jar to the classpath