码迷,mamicode.com
首页 > 编程语言 > 详细

actor运行报错:java.lang.ClassNotFoundException

时间:2016-04-23 22:56:10      阅读:616      评论:0      收藏:0      [点我收藏+]

标签:

object SimpleAkkaTest {

  def main(args: Array[String]) {
    val system = ActorSystem.create("system")
    val work =system.actorOf(Props[Worker],"worker-1")
    work ! 1
  }

}
class Worker extends Actor {
  override def receive = {
    case 1=> println("1")
    case _ => println("_")
  }
}

Exception in thread "main" java.lang.ClassNotFoundException: akka.simpleAkka.SimpleAkkaTest
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)

解决方案:项目->open module setting->Modules->Dependencies  加上scala sdk的library

actor运行报错:java.lang.ClassNotFoundException

标签:

原文地址:http://www.cnblogs.com/sxg2012/p/5425786.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!