Skip to content

java.lang.NoClassDefFoundError: cats/free/Inject$ building master #54

@ml10

Description

@ml10

I was going to see if I could debug why the Applicative composition exercise doesn't display correctly and in trying to build exercises-cats, I ran into the NoClassDefFoundError above.

I checked on another computer and then tried the hseeberger/scala-sbt docker image to make sure I was starting clean. I got the same result all three times.

Steps to reproduce with hseeberger/scala-sbt docker image:

  1. sudo docker run -it --rm hseeberger/scala-sbt
  2. git clone https://github.com/scala-exercises/exercises-cats.git
  3. cd exercises-cats/
  4. sbt compile publishLocal

These steps should yield this stack trace:

java.lang.NoClassDefFoundError: cats/free/Inject$
	at github4s.Github.repos$lzycompute(Github.scala:40)
	at github4s.Github.repos(Github.scala:40)
	at org.scalaexercises.compiler.Compiler.org$scalaexercises$compiler$Compiler$$fetchContributions$1(Compiler.scala:163)

As a quick attempt to fix this, I added cats-free to the build.sbt file, and this yielded another stack trace.

java.lang.NoSuchMethodError: cats.free.Free.foldMap(Lcats/arrow/FunctionK;Lcats/Monad;)Ljava/lang/Object;
	at github4s.Github$GithubIOSyntaxEither.execK(Github.scala:58)
	at github4s.Github$GithubIOSyntaxEither.exec(Github.scala:64)
	at org.scalaexercises.compiler.Compiler.org$scalaexercises$compiler$Compiler$$fetchContributions$1(Compiler.scala:167)

It looks like I need another version of cats-free, but I'm not sure which one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions