Cannot use Scala class in Java

I believe Scala, and Java can use classes from each other.

However, I found myself in a situation where my Java class cannot use the Scala class in one package.

The Scala class is defined as:

class CustomerService extends AbstractCustomerService { 

Code trying to use this bit of code:

 public Deployer() { singletons.add(new CustomerService()); } 

I got an error:

 [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 tell me about this?

Many thanks

+6
source share
1 answer

configure pom.xml according to this article: joint connection of scala and java sources

+9
source

Source: https://habr.com/ru/post/908983/


All Articles