-1

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!

Nicolas
  • 1,193
  • 1
  • 10
  • 25
  • 1
    It's really difficult to make any assumption until you provide more details and at least code example showing what you tried. Based on the error only, I would assume you didn't provide native library required by opencv or it was not found. Did you check this https://stackoverflow.com/questions/39817457/opencv-3-0-0-java-lang-unsatisfiedlinkerror-in-eclipse – zoran jeremic Feb 01 '22 at 04:34
  • 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) – AminM Feb 01 '22 at 05:40
  • Does this answer your question? [OpenCV java.lang.UnsatisfiedLinkError](https://stackoverflow.com/questions/28220675/opencv-java-lang-unsatisfiedlinkerror) – Christoph Rackwitz Feb 01 '22 at 12:18
  • Thanks @ChristophRackwitz but this not solve my issue :( – Nicolas Feb 01 '22 at 12:25

2 Answers2

0

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)

AminM
  • 822
  • 4
  • 11
0

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.

Nicolas
  • 1,193
  • 1
  • 10
  • 25