2
votes

I am a newbie to play framework, just downloaded the Play 2.4.2, created a project using the

activator new

After that, I tried to convert project to eclipse, but the command

 activator eclipse

resulted in the error enter image description here

I have converted it to eclipse project by starting activator ui and through activator web console, converted project to eclipse. But it in the UI also, I have seen the above error message, but it has converted to eclipse project.

Imported the project into eclipse and it is showing error in the Application.java file as shown below. enter image description here

I have downloaded the Scala IDE, tried to import the project, still the same. I have started the application from command line using

activator run

My app is listening on 9000, and refreshed the project in the IDE, still the cannot find symbol is unresolved.

The jump start is not smooth, How to resolve this?

2
You have to start activator in the folder of your project, the folder were your project's build.sbt is. Go to this folder, type activator clean and afterwards activator eclipse (or activator idea for Intellij Idea) and your errors should vanish.Kris
Inside project\plugins.sbt file added the following line //Eclipse Plugin addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")srk

2 Answers

2
votes

This documentation is worth a read. It explains adding some settings to the build.sbt:

$ activator new eclipse

Fetching the latest list of templates...

Browse the list of templates: http://typesafe.com/activator/templates
Choose from these featured templates or enter a template name:
  1) minimal-akka-java-seed
  2) minimal-akka-scala-seed
  3) minimal-java
  4) minimal-scala
  5) play-java
  6) play-scala
(hit tab to see a list of all templates)
> 5
OK, application "eclipse" is being created using the "play-java" template.

To run "eclipse" from the command line, "cd eclipse" then:
/Users/ben/projects/eclipse/activator run

To run the test for "eclipse" from the command line, "cd eclipse" then:
/Users/ben/projects/eclipse/activator test

To run the Activator UI for "eclipse" from the command line, "cd eclipse" then:
/Users/ben/projects/eclipse/activator ui

$ cd eclipse/
$ echo 'addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")' >> project/plugins.sbt
$ ./activator compile
...
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.10/sbt_0.13/4.0.0/jars/sbteclipse-plugin.jar ...
[info]  [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0!sbteclipse-plugin.jar (2998ms)
...
[info] Compiling 6 Scala sources and 2 Java sources to /Users/ben/projects/eclipse/target/scala-2.11/classes...
[success] Total time: 36 s, completed 05-Jul-2015 14:00:25
$ ./activator eclipse
[info] Loading project definition from /Users/ben/projects/eclipse/project
[info] Set current project to eclipse (in build file:/Users/ben/projects/eclipse/)
[info] About to create Eclipse project files for your project(s).
[info] Successfully created Eclipse project files for project(s):
[info] eclipse
$

Then import as an existing project within ScalaIDE (your Eclipse). Then all should be good.

0
votes

It's no problem here.
Scala template must be compiled first (after you start project and access any page) and then eclipse project must take reference library (contains these class) to solve error.
Try to start project, access a page and re-generate eclipse project from activator console and import to IDE again.