Play-2.1.3-Java "routes" cannot be resolved in Eclipse

690 views
Skip to first unread message

Peter Warbo

unread,
Sep 2, 2013, 2:46:32 PM9/2/13
to play-fr...@googlegroups.com

I'm a beginner user of Play Framework 2.1.3 and I have just created a new Java application and I have run play eclipse to generate the eclipse project for it. I have also tested so that it works by doing aplay run.

So I'm following this tutorial and there is a step where you should add this piece of code:

public static Result index() {
  return redirect(routes.Application.tasks());
}

But I'm getting the message "routes cannot be resolved". I have also tried play compile and in Eclipse doing a clean and refreshing the project to no avail.

Sebas

unread,
Sep 5, 2013, 1:31:10 PM9/5/13
to play-fr...@googlegroups.com, m...@peterwarbo.com
tried controllers.routes ?

Yvonne Dao Lam

unread,
Sep 5, 2013, 5:18:51 PM9/5/13
to play-fr...@googlegroups.com, m...@peterwarbo.com
Did you have these in your conf/routes file?
# Home page
GET     /                       controllers.Application.index()
                                
# Tasks          
GET     /tasks                  controllers.Application.tasks()
POST    /tasks                  controllers.Application.newTask()
POST    /tasks/:id/delete       controllers.Application.deleteTask(id: Long)

Matthias Kurz

unread,
Jan 13, 2017, 7:00:47 AM1/13/17
to Play Framework, m...@peterwarbo.com
In case someone else experience this bug:
Just upgrade sbteclipse to version 5.1.0 (which was released on January 12th 2017) - it finally fixes this bug.
Also make sure you followed the IDE setup instruction:
Reply all
Reply to author
Forward
0 new messages