1

I am a newbie to Scala and I wanted to add an external JAR file into the program and use it's functions.

So what I did was copied the JAR into lib folder and then added the below line as well in my SBT file:

unmanagedBase := baseDirectory.value / "lib"

I followed this post Link For Similar Question

After this, when I import the class I find a class not found error. I am not sure why it is throwing a class not found when I added the jar into the lib folder.

Any help is appreciated.

Mike Allen
  • 8,139
  • 2
  • 24
  • 46
joker21
  • 339
  • 2
  • 4
  • 14
  • What is your sbt version? – Learner Nov 28 '17 at 04:50
  • 3
    Usually, it is sufficient to put your unmanaged JAR files into the `lib` directory of your project - that is the default definition of `unmanagedBase` and so you do not need to redefine it in your _SBT_ build file. (The only time you need to do that is if you wanted to put unmanaged JARs in a folder with a different name to `lib`.) What is the name of the unmanaged JAR file, what is the exact `ClassNotFoundException` message? What does your `import` statement look like? – Mike Allen Nov 28 '17 at 05:03

0 Answers0