Fixing Gradle Error: Cannot infer Scala class path because no Scala library Jar was found on class path: configuration ‘:compile’

When you get this error:

Cannot infer Scala class path because no Scala library Jar was found on class path: configuration ':compile'

This indicates that you need to tell gradle which version of Scala you’re interested in, so that it can download it.

To fix this, add the following to build.gradle:

dependencies {
    compile 'org.scala-lang:scala-library:2.10.1'
}

One Reply to “Fixing Gradle Error: Cannot infer Scala class path because no Scala library Jar was found on class path: configuration ‘:compile’”

  1. This is exactly, that i was looking for.
    Is there any way to tell gradle and idea to use local scala library(Scala SDK) rather then downloading from maven repository.

Leave a Reply

Your email address will not be published. Required fields are marked *