Setting up Akka with Eclipse

醉酒当歌 提交于 2020-01-03 10:56:30

问题


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?


回答1:


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.




回答2:


I use this to start the 1.x microkernel from the IDE, I think it came from Henke:

Main class : akka.kernel.Main

VM args: -Xms256m -Xmx1024m -Dakka.home=./kernel -Dlogback.configurationFile=src/main/resources/logback.xml

In kernel directory I have a symlink config -> ../src/main/resources

In the kernel directory I also have an empty deploy directory. Not used, but must be there.



来源:https://stackoverflow.com/questions/12612287/setting-up-akka-with-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!