0

I'm having problems loading an OpenCV library on a Linux server. I'm trying to deploy an application with Java components to this environment. I first installed OpenCV using Ubuntu on Windows, then copied the OpenCV .so files into a folder of the Java classpath so they can be found. The structure of the .so files look like this:

structure of .so files

If I then try to load the library using System.loadLibrary(NATIVE_LIBRARY_NAME);, it gives the following error:

CRITICAL - M2EE: java.lang.UnsatisfiedLinkError: 
/home/vcap/app/data/tmp/project-userlib___415031196935836591/libopencv_java342.so:  
/home/vcap/app/model/resources/libopencv_ml.so.3.4: file too short

I think this has something to do with copying the linked .so files to Windows and then deploy them back to Linux, so the link of the libraries is somehow lost, but I have no idea how to do this the proper way.

Hope anyone can help me.

Regards,

Ward

4
  • I don't see why you are coping from windows when you can install OpenCV directly on Linux server. Have you tried installing OpenCV on Linux Server ?? Commented Sep 6, 2018 at 13:03
  • It's a simple installation process, steps are given in this link docs.opencv.org/3.4/d7/d9f/tutorial_linux_install.html Commented Sep 6, 2018 at 13:04
  • It's an IBM Bluemix server, and we push the application to it, with the .so libraries included. I don't know if there is a way to directly install the OpenCV library on the server. Commented Sep 6, 2018 at 13:48
  • Make sure the file(soft link) is not broken! Commented Sep 7, 2018 at 1:15

1 Answer 1

1

Well, you won't be able to install dependencies/libraries over IBM Bluemix server, unfortunately.

However, you can use Java Runtimes available on IBM Bluemix server to create a development envorinment and then install OpenCV or any other dependencies/libraries.

This way, you can use it in your application as well.

Note: If you need any help in doing so, you can ask me or you can contact the IBM Bluemix support team, they will be happy to assist and guide you in this regard.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you very much for your answer. Is this the right tutorial to do this: ibm.com/developerworks/websphere/library/techarticles/…? If not, could you help me find one?
Yeah, it seem so. Have you tried contacting IBM Bluemix support ??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.