问题描述
我正在试图用Eclipse和Scala获得一个简单的Akka程序。我用g8用Akka(g8 typesafehub / akka-scala-sbt)创建sbt项目,然后用sbteclispe创建Eclipse项目。当我将项目导入到Eclipse中时,我发现错误说我错过了Akka。有没有什么办法可以用Eclipse构建一个Akka项目?最简单的是添加 sbteclipse
插件到你的Sbt构建。它会自动生成Eclipse的项目文件,以便您可以导入项目及其所有设置,包括类路径。为此,请在项目根目录下的 project / plugins.sbt
( not )下添加以下内容,但在项目
子目录):
addSbtPlugin(com.typesafe.sbteclipse%sbteclipse-plugin %2.1.0)
然后,开始 sbt
并提示写入 eclipse
。你应该看到:
> eclipse
[info]关于为您的项目创建Eclipse项目文件。
[info]成功创建项目的Eclipse项目文件:
[info]测试项目
然后转到Eclipse并导入您的项目。
I am trying to get a simple Akka program building with Eclipse and Scala. I used g8 to create the sbt project with Akka(g8 typesafehub/akka-scala-sbt) and then sbteclispe to create the Eclipse project. When I import the project into Eclipse I'm given errors saying I am missing Akka. Is there any way that I can build an Akka project with Eclipse?
The simplest thing is to add the sbteclipse
plugin to your Sbt build. It automatically generates project files for Eclipse, so that you can import your project with all its settings, classpath included. To do so, add the following under project/plugins.sbt
(not in the root of your project, but under the project
subdirectory):
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
then, start sbt
and at the prompt write eclipse
. You should see:
> eclipse
[info] About to create Eclipse project files for your project(s).
[info] Successfully created Eclipse project files for project(s):
[info] Test Project
Then go to Eclipse and Import your project.
这篇关于用Eclipse设置Akka的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!