Closed gfiedler closed 4 years ago
use
ln -s /usr/lib/jni/libopencv_java320.so /usr/lib/libopencv_java.so
# cd /usr/lib
# ln -s /usr/lib/jni/libopencv_java320.so libopencv_java.so
# ldconfig
# ls -l libopencv_java*
lrwxrwxrwx 1 root root 17 Feb 10 10:43 libopencv_java320.so -> libopencv_java.so
lrwxrwxrwx 1 root root 33 Feb 10 10:43 libopencv_java.so -> /usr/lib/jni/libopencv_java320.so
# ldconfig -p | grep libopencv
libopencv_xphoto.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_xphoto.so.3.2
libopencv_xobjdetect.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_xobjdetect.so.3.2
libopencv_ximgproc.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ximgproc.so.3.2
libopencv_viz.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_viz.so.3.2
libopencv_videostab.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_videostab.so.3.2
libopencv_videoio.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_videoio.so.3.2
libopencv_video.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_video.so.3.2
libopencv_text.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_text.so.3.2
libopencv_surface_matching.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_surface_matching.so.3.2
libopencv_superres.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_superres.so.3.2
libopencv_structured_light.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_structured_light.so.3.2
libopencv_stitching.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_stitching.so.3.2
libopencv_stereo.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_stereo.so.3.2
libopencv_shape.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_shape.so.3.2
libopencv_saliency.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_saliency.so.3.2
libopencv_rgbd.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_rgbd.so.3.2
libopencv_reg.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_reg.so.3.2
libopencv_plot.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_plot.so.3.2
libopencv_photo.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_photo.so.3.2
libopencv_phase_unwrapping.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_phase_unwrapping.so.3.2
libopencv_optflow.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_optflow.so.3.2
libopencv_objdetect.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so.3.2
libopencv_ml.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ml.so.3.2
libopencv_line_descriptor.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_line_descriptor.so.3.2
libopencv_java320.so (libc6,x86-64) => /usr/lib/libopencv_java320.so
libopencv_imgproc.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.3.2
libopencv_imgcodecs.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2
libopencv_highgui.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.3.2
libopencv_hdf.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_hdf.so.3.2
libopencv_fuzzy.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_fuzzy.so.3.2
libopencv_freetype.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_freetype.so.3.2
libopencv_flann.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_flann.so.3.2
libopencv_features2d.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_features2d.so.3.2
libopencv_face.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_face.so.3.2
libopencv_dpm.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_dpm.so.3.2
libopencv_datasets.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_datasets.so.3.2
libopencv_core.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_core.so.3.2
libopencv_ccalib.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ccalib.so.3.2
libopencv_calib3d.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.3.2
libopencv_bioinspired.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_bioinspired.so.3.2
libopencv_bgsegm.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_bgsegm.so.3.2
libopencv_aruco.so.3.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_aruco.so.3.2
The issue still exists.
Java versions:
# ls -l libopencv_java*
lrwxrwxrwx 1 root root 17 Feb 10 10:43 libopencv_java320.so -> libopencv_java.so
lrwxrwxrwx 1 root root 33 Feb 10 10:43 libopencv_java.so -> /usr/lib/jni/libopencv_java320.so
... this looks odd: like some roundabout
This is a listing of /usr/lib
. The first symlink is created by ldconfig
.
In my test setup the opencv libs are in
/usr/local/lib
(installed with linuxbrew)
The libopencv_javaxxx.so
is in /usr/local/share/java/opencv4/
(manually built)
I run
java -jar sikulixapi.jar -v -r test.js
(a simple print("hello")
Without any symlink opencv_java.so
I get:
[1770 debug] RunTime:loadlib: trying opencv_java411
[error] RunTime:loadLib: opencv_java (failed) probably dependent libs missing:
no opencv_java in java.library.path: [/usr/java/packages/lib, /usr/lib/x86_64-linux-gnu/jni, /lib/x86_64-linux-gnu, /usr/lib/x86_64-linux-gnu, /usr/lib/jni, /lib, /usr/lib]
[error] Save your work, correct the problem and restart the IDE!
With a symlink in any of the above listed folders it works as it should.
So I gues you have to sort out your locations and symlinks.
Your test setup succeeds with my environment.
No ExceptionInInitializerError
anymore after changing my jython
script to
#!/bin/sh
exec java -cp jython-standalone-2.7.1.jar:sikulixapi-2.0.1.jar -Dpython.path=sikulixapi-2.0.1.jar org.python.util.jython "$@"
Thank you anyway!
I created the
jython
scriptWhen I execute
pattern.py
with
then I got the following error
In the Wiki I found the hint
So I have installed
which created a file
/usr/lib/jni/libopencv_java320.so
(Ubuntu 18.04).I've tried several things like
ldconfig
,LD_LIBRARY_PATH
,-Djava.library.path=
with no success.I would appreciate it very much if you would help me how to make the link in the runtime loader path.