search

Home  >  Q&A  >  body text

scala - 使用 sbt 的 eclipse 插件配置开发环境碰到的问题

我在windows上用sbteclipse插件生成了了一个项目,并在build.sbt文件中配置了项目依赖如下:

    name := "xxxxx"

    version := "0.0.1-SNAPSHOT"

    libraryDependencies += "org.springframework" % "spring-jdbc" % "3.1.0.RELEASE"

之后使用 sbt compile命令想编译了一次,看到依赖的包都下载下来了。然后又使用sbt console进入了scala EPEL尝试导入spring的相关包也都可以,没有问题。

但是在eslipse里面导入项目之后再尝试 import org.springframework._则提示找不到相关的类。spring jdbc的相关功能(注解,Datasource类等等) 都无法使用。。

头疼死,求帮忙!

迷茫迷茫2801 days ago844

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-21 11:19:05

    It feels like there is a missing command. If you are using maven, you need to execute it

    mvn eclipse:eclipse
    

    sbt I guess there is a similar command

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-21 11:19:05

    It is recommended to use IDEA, which can directly import sbt projects, just like importing mavne projects.
    At the same time, there are also plug-ins such as sbt-idea that can be used.

    For Eclipse, you can use the sbteclipse plug-in: https://github.com/typesafehub/sbteclipse

    reply
    0
  • PHPz

    PHPz2017-04-21 11:19:05

    It is recommended to use IntelliJ Idea. Eclipse’s support for Scala is still not as good as Idea.

    reply
    0
  • Cancelreply