I followed a tutorial here and although I got the entire tutorial working just fine, one of the classes in my IntelliJ project is marked with \"red warnings\". I cannot fig
Views / templates are not classes, which is why IDE cannot recognize them. IDE should be configured to look for the compiled version of the views. This click will fix your issue
Go to the Run configuration for your Play project and remove the 'Make' step from the "Before Launch" section. Then, IntelliJ would simply run the Play project without attempting to compile, and the views will get compiled automatically.
Until the views are compiled, IntelliJ doesn't know they exist, and can't make the project itself. Clearly this is a problem with IntelliJ's plugin, but since you're already relying on Play to do your compiling dynamically, this workaround doesn't hurt the workflow too much.
The Play 2.0 support plugin is only available in the IntelliJ IDEA Ultimate edition.
I managed to make it work on IDEA Community 14 by solely cleaning IDEA cache (File -> Invalidate Caches / Restart)
The routes file and the views are compiled only when the project is first loaded in the browser. Till then, IntelliJ shows the error as it cannot find those classes. But the errors magically dissppear when you run the application and load it into browser.
You can verify this in the play console. After you do a play run
, and load the url localhost:9000
in the browser, you can see compilation messages in the play console saying
...compiling 22 scala sources....
Note that javascript routes seem to be still ignored from a strange reason, so this is not a perfect solution. Nevertheless, it is better than nothing.