bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.51k stars 1.58k forks source link

java.lang.unsatisfiedlinkerror akaze init final #1982

Closed itqxsab136681 closed 1 year ago

itqxsab136681 commented 1 year ago

linux 1.5.8

import org.bytedeco.opencv.opencv_features2d.*; AKAZE akaze = AKAZE.create();

Method threw 'java.lang.UnsatisfiedLinkError' exception. java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.***.common.tracer.BizRuntimeException: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.opencv.opencv_features2d.AKAZE

saudet commented 1 year ago

Please include ALL the JAR files in your class path.

itqxsab136681 commented 1 year ago
org.bytedeco javacv-platform 1.5.8

i'm used all platform,it's ok local good,but remote error for linux-x86_64

saudet commented 1 year ago

Are you sure your Linux distribution is compatible with CentOS 7? In particular, it's not Alpine?

itqxsab136681 commented 1 year ago

i'm sry,One thing I missed is that akaze cannot be successfully initialized, and other classes are normal (including not limited to mat, classes under improc, etc.)。Please help to confirm whether it is caused by the special environment of linux。

saudet commented 1 year ago

Works fine on my Linux machine. System.out.println(AKAZE.create()); displays something like this:

org.bytedeco.opencv.opencv_features2d.AKAZE[address=0x7fb208ee41a0,position=0,limit=0,capacity=0,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fb208ee40b0,deallocatorAddress=0x7fb1491dcc50]]

Must be something else unrelated to Linux...

saudet commented 1 year ago

Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" to get more information on the console.

itqxsab136681 commented 1 year ago

Hello, I can see that the console has printed relevant logs after setting the properties of native, but my remote linux platform has a separate log system, and I still cannot see detailed error messages . I speculate that it may be an error caused by the abnormality of the link library related to feature detection. The only difference between mine and normal operation is the environment. in CentOS 7

saudet commented 1 year ago

If your log system is compatible with SLF4J, please set "org.bytedeco.javacpp.logger" to "slf4j" instead.

itqxsab136681 commented 1 year ago

Thank you very much, this problem was finally solved, mainly by installing a new gtk2 in docker.

saudet commented 1 year ago

Duplicate of https://github.com/bytedeco/javacpp-presets/issues/593