Not a valid command: eclipse (similar: help, alias)

4k views Asked by At

C:\Users\Shweta\Hi>sbt

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

[info] Loading global plugins from C:\Users\Shweta.sbt\0.13\plugins

[info] Loading project definition from C:\Users\Shweta\Hi\project

[info] Set current project to hi (in build file:/C:/Users/Shweta/Hi/)

run

[info] Running Hi

Hi!

[success] Total time: 1 s, completed 24 Feb, 2017 12:41:13 PM

compile

[success] Total time: 0 s, completed 24 Feb, 2017 12:41:17 PM

eclipse

[error] Not a valid command: eclipse (similar: help, alias)

[error] Not a valid key: eclipse (similar: deliver, licenses, clean)

[error] eclipse

[error] ^

3

There are 3 answers

0
Art Licis On

You need to add sbteclipse plugin to your plugin definition file (for this, most likely the global one,- in your setup C:\Users\Shweta.sbt\0.13\plugins\plugins.sbt), after that you will be able to use eclipse command.

Make sure to call reload in sbt shell if the file was updated without leaving the shell.

Check out sbteclipse GitHub for more details.

0
AudioBubble On

With "current" undocumented as far as I know version 1.2.0 (as of Aug 6th 2018) it would be:

C:\Users\Shweta.sbt\1.0\plugins\plugins.sbt

I tested this on my Windows 10 and eclipse command was successful.

0
jwebuser On

You need the sbteclipse plugin definition in order to execute the eclipse command.

You can add the plugin definition either:

  • in the global plugins file at ~/.sbt/<SBT_VERSION>/plugins/plugins.sbt
  • or in your local project plugins file at <PROJECT_DIR>/project/plugins.sbt

The plugin has to be added by adding the definition as:

`addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "<PLUGIN_VERSION>")`

For example:

`addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")`

After adding the plugin definition you can run the eclipse command as:

[play-scala-app] $ eclipse
[info] About to create Eclipse project files for your project(s).
...

See also the sbteclipse project documentation at https://github.com/sbt/sbteclipse