Create new scala project shows error in eclipse

I'm new to play framework(Scala), I created a new project using activator new sample play-scalacommand, sample is my project name. Then I successfully completed the project using the command activator run. When I launched the team activator eclipse, she showed

[error] Not a valid command: eclipse (similar: help, alias)
[error] Not a valid project ID: eclipse
[error] Expected ':'
[error] Not a valid key: eclipse (similar: deliver, licenses, clean)
[error] eclipse

So, from some internet offers I added addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

this line in my sample plugins.sbtfile.This project fixed the invalid command error, but when I imported the project in eclipse it showed an object index is not a member of package views.htmlerror, please help me fix the error

plugins.sbt

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0")

// web plugins

addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6")

addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

enter image description here

+4
source share
6 answers

create a new plugins.sbt file inside the project folder.

Directory path example

C:\Workspace\PlayFramework\activator-1.3.6-minimal\play-java-intro\project\

Add the content below to the file

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

eclipse

activator eclipse

- .

+1

\project\build.sbt \project\plugins.sbt? , .

sbteclipse

0

-. ( ):

target/scala-2.11/src_managed/main
target/scala-2.11/twirl/main

, ( ), , .

, ScalaIDE? 4.1.0 , .

Update:

. , , , , .

, , - Java Build Path :

target/scala-2.11/routes/main
target/scala-2.11/twirl/main
0

$ activator clean compile, Eclipse Package Explorer. Eclipse .

0

, .. , .. ( 0.13).

...

/.sbt/0.13/plugins /.sbt/0.13/plugins/plugins.sbt

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

which worked .. version 2.5 is very old .. so maybe 4.0.0 or something would be better.

0
source

I had the same problem with version 2.3 to play 2.5, just added addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")plugins.sbt, but still had an error Invalid command: eclipse

So, I realized that I have another sbt file in / project 'activator-sbt-eclipse-shim.sbt', I do not know why he was there, but he used the old version addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

I just changed this file to the correct version and it worked

0
source

All Articles