60 9
Top 1% !
Pearl of Wisdom
Popularity: 8043rd place
No tags for this snippet yet.

Adding a *.jar file (originating from java-wrapped C++ code)  to an SBT project classpath

I thought using unmanaged dependencies in SBT projects was simply dropping a jar file
into the  lib directory, until I bought an SDK for a biometric device.

Both the C++ and the Java packages were provided. I opted for the Java package, copying the provided jar file and the JNI  (*.so) files into the appropriate locations and configuring the java.library.path property as appropriate.

I dropped a copy of the jar file into my lib directory; but I had compilation errors starting right from the import statement. All attempts failed, as long as I treated the jar file as an unmanaged dependency

I found the answer in installing it a managed dependency.

Below is my own humble code:
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
/** * In my <code>build.sbt</code> file, I appended a blank line and then the following: */ libraryDependencies += "groupID" % "artifactId" % "revision" from "file:///home/Danogbuagu/Projects/biometric-lib/filename.jar" // where, // groupID for example is like: com.zigzagcompany // artifactId for example is like: zigzag // revision for example is like: 1.3.4 // Remember the line befor the code and that after.
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus