Scala code in Java

I am new to Scala.

Can we write Scala code in Java and create .JAR file that can be executed in Hadoop edge Node.

Also, what dependency we need to add in Intellij’s POM.xml to configure Scala.

1 Like

Scala code compiles to class files that can be packed in a .jar. Java code can link and run against that code, though not all Scala code produces interfaces that make it easy or even possible at all for Java to interact with.

If you don’t have a good idea what you can and can’t do to make sure your scala code will be easily callable from Java, it’s a good idea to implement a java interface so you’re sure your Scala code can be called through that.

2 Likes