java scala maven,在Java Maven项目中使用Scala类的编译错误

I have a java maven project , i installed scala plugin for eclipse and added scala nature to my project . Now , i have written some custom scala Actors and some other utility classes .I am using these scala classes in my java code . while writing the code , it doesn't throw any errors .But , when i do maven clean /build , it throws compilation error's like below

11/8/11 10:45:23 AM : [ERROR] ............\Simple.java:[86,10] cannot find symbol

symbol : variable ExecutorObject

location: class com.ms.scala.Simple

11/8/11 10:45:23 AM : [INFO] 2 errors

11/8/11 10:45:23 AM : [INFO] -------------------------------------------------------------

11/8/11 10:45:23 AM : Build errors for Project; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project : Compilation failure

Eclipse IDE : helios -3.5 , Scala - 2.9.2 which comes with the plugin

i guess there is a custom compiler configuration for doing this ? i also have an other newbie question

how do you start scala actor directly in java and send a message to it ? all i can see is the act() method . i want to do this

actor {

CustomActor ! Message

}

in java

thank you

sanre6

解决方案

For the first part, have you added the scala compilation step to your maven pom? Have you added the maven-scala-plugin to your pom?

For the second part, as Mirco says, there is no simple way to define an Actor in Java. You'll have to define it in Scala, but you can then start it and send messages to it in Java.

Simply call start() on the instance, and then you should be able to pass messages to it using the ! method. This will be available in java, but it is called $bang.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值