0

Problem is that - I have a program that builds and runs fine. It is written in Scala and it uses the Kafka Streams DSL. I was to use the new kafka-streams-scala package and I am using Maven right now. I can't use SBT right now. When I add the dependency

    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-streams-scala_2.11</artifactId>
        <version>2.0.0</version>
    </dependency>

I then get all kinds of errors in the code, that already runs. I can't even do the following import statement
import scala.collection.JavaConverters._.

When I do, I get the following error object language is not a member of package org.apache.kafka.streams.scala.

Why is this happeneing and how can I fix it?

uh_big_mike_boi
  • 3,350
  • 4
  • 33
  • 64
  • Is this in IntelliJ? Have you tried doing a clean and re-build? – jacks Sep 12 '18 at 18:39
  • Yes IntelliJ. Yes I have done that. – uh_big_mike_boi Sep 12 '18 at 18:48
  • Where did you get that Maven config from? I think you have a problem with resolving kafka-streams-scala, probably because I don't think there is a version `2.0.0`. Try changing version to `0.2.0` and then refresh your dependencies - https://stackoverflow.com/questions/9980869/force-intellij-idea-to-reread-all-maven-dependencies – jacks Sep 12 '18 at 19:01
  • I think you are talking about the old Scala wrapper by Lightbend. Anyway, if maven couldn't find it in the repository it would have given a nice error. And here is a link to the new Scala wrapper https://mvnrepository.com/artifact/org.apache.kafka/kafka-streams-scala_2.12/2.0.0 – uh_big_mike_boi Sep 12 '18 at 19:02
  • Ah sorry ye, my bad. – jacks Sep 12 '18 at 19:04

1 Answers1

0

I needed to prefix _root_ to all the Scala core packages like for example

import _root_.scala.collection.JavaConverters._
uh_big_mike_boi
  • 3,350
  • 4
  • 33
  • 64