-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classes not found: org.bytedeco.javacpp.BytePointer and org.bytedeco.javacpp.Pointer #27
Comments
@jpsacha Would you have an idea of what might be happening? It seems like the JavaCPP dependencies are not getting pulled in. |
I cannot reproduce the issue. I am running Cookbook examples with no problem (with 0.9). I had an issue in FlyCapture2 with a missing libiomp5md.dll (still need to figure that one out, something happened in 0.9, I just added it to path), I am running it it with 0.9.1-SNAPSHOT. But that does not seem to be related. The error report is not very specific about how to reproduce the issue. |
Thanks for the feedback @jpsacha. I haven't tried to figure it out myself, no. @g00dnatur3 please provide more details about how we may go about reproducing your issue, thanks. |
I'm using a MacBook pro with Eclipse Kepler & jdk 7. I have a very simple Play Framework java project. I go ahead and add the sbt dependency of the 0.9 version. I will post the sample code later, I don't have it with me-- but its very simple example code taken from stack overflow. |
Containers like that usually have special instructions for libraries using JNI. Make sure you follow those instructions as well. Thanks |
This issue seems to occur for SBT (0.13.5) projects (Play uses SBT).
Gradle works just fine, so I suspect this has something to do with the way SBT handles the javacpp POM.
|
In SBT you need to also load opencv presets including native binaries: val javacppVersion = "0.9"
libraryDependencies ++= Seq(
"org.bytedeco" % "javacv" % javacppVersion,
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacppVersion) classifier "",
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacppVersion) classifier platform,
) If you know the platform you are running on you can hard-code it. You can also determine it automatically: val platform = {
// Determine platform name using code similar to javacpp
// com.googlecode.javacpp.Loader.java line 60-84
val jvmName = System.getProperty("java.vm.name").toLowerCase
var osName = System.getProperty("os.name").toLowerCase
var osArch = System.getProperty("os.arch").toLowerCase
if (jvmName.startsWith("dalvik") && osName.startsWith("linux")) {
osName = "android"
} else if (jvmName.startsWith("robovm") && osName.startsWith("darwin")) {
osName = "ios"
osArch = "arm"
} else if (osName.startsWith("mac os x")) {
osName = "macosx"
} else {
val spaceIndex = osName.indexOf(' ')
if (spaceIndex > 0) {
osName = osName.substring(0, spaceIndex)
}
}
if (osArch.equals("i386") || osArch.equals("i486") || osArch.equals("i586") || osArch.equals("i686")) {
osArch = "x86"
} else if (osArch.equals("amd64") || osArch.equals("x86-64") || osArch.equals("x64")) {
osArch = "x86_64"
} else if (osArch.startsWith("arm")) {
osArch = "arm"
}
val platformName = osName + "-" + osArch
println("platform: " + platformName)
platformName
} You can see an example of a complete build.sbt file in javacv-examples. |
Aah, thanks so much @jpsacha. My original sbt was missing: |
Thanks @shirish87! @g00dnatur3, does adding the |
Well, I've added that to the |
Is there a reason i keep getting ClassNotFound issues for org.bytedeco.javacpp.BytePointer and org.bytedeco.javacpp.Pointer?
I'm using this version in my sbt: "org.bytedeco" % "javacv" % "0.9"
Am I missing something or is this a bug...
Thanks for the help
The text was updated successfully, but these errors were encountered: