Home > OS >  Open CV java.lang.UnsatisfiedLinkError
Open CV java.lang.UnsatisfiedLinkError

Time:02-01

Hey guys I am working on a Scala/Java project and we are using OpenCv to image processing. I have been stuck for several days trying to import the library, I went through different errors but right now the one I am having in the last attempts is

Uncaught error from thread [application-akka.actor.default-dispatcher-9]: org.opencv.imgcodecs.Imgcodecs.dicomJpgMatRead_0(JII)J, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[application
java.lang.UnsatisfiedLinkError: org.opencv.imgcodecs.Imgcodecs.dicomJpgMatRead_0(JII)J

Please, I would be very grateful if someone could help me. I don't know what else to try.

Thank you in advance!

CodePudding user response:

This generally happens when your code has access to the class when you compile but not when you run. In many IDEs it's due to where you are placing the classes or how you are deploying the code. UnsatisfiedLinkError refers specifically to a DLL (or Lib in Linux) that it isn't finding at runtime. Does your running code have access to the dynamically linked library? (obviously not, find out why)

CodePudding user response:

Hey guys thank you for the response. I try (at least I think) all the solutions I found including the onces that are in the link you mentioned @zoranjeremic.

I am working with a Java project that has inside one class "JDicomImageLoader" that is the one who needs the opencv library. Inside of it I have a method call setup:

enter image description here

Now I am using a System.load with absolute path but I also try doing System.loadLibrary with the respective "java.library.path".

Then I am compile this Java project (sbt compile) and publish locally (sbt publishlocal) to use in my Scala project.

  •  Tags:  
  • Related