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:
post this code
* 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"
// 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,
and follow our Channels