I believe Scala and Java can use classes from each other.
However, I found myself in a situation that my Java class cannot use a Scala class in the same package.
The scala class is defined as:
class CustomerService extends AbstractCustomerService {
The code trying to use this bit of code is:
public Deployer() {
singletons.add(new CustomerService());
}
The error I got is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3:compile (default-compile) on project orderservice: Compilation failure
[ERROR] \devel\raven\services\orderservice\service\src\main\scala\com\mxyy\orderservice\customer\Deployer.java:[12,31] cannot find symbol
[ERROR] symbol : class CustomerService
[ERROR] location: class com.mxyy.orderservice.customer.Deployer
Can someone give me some hint about this?
Many thanks
configure your pom.xml
according to this article:
joint compliation of scala and java sources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With