class Demo {
}
object Demo {
def userListener(userName: String, userMac: MACAddress, bytes: Double) = {
println("userListener: " + userName + userMac + bytes)
}
}
And calling Java code looks like this:
public class UserSubscriber {
public void update(String u, MACAddress m, double b) {
System.out.println("UserSubscriber: Received: user= " + u + " mac=" + m + " bytes=" + b);
Demo.userListener(u, m, b);
}
I don't get any compilation failures. I had started this as a Java project in Eclipse (scala version from coursera scala class) and then added "scala nature" to the project before creating Demo scala file.
I don't see any runtime errors but Demo.userListener is not called. In debugger, I see an exception being thrown for class not found and class name is not Demo but scala/Object. Any help is appreciated.
}
java.lang.NoClassDefFoundError: scala/ScalaObject