2

I need to create a runnable jar in Windows with Eclipse and start it with Linux

I'm getting an unsatisfiedLinkError while loading OpenCv. I have edited the correct library path for a Linux computer in Eclipse and finally created a runnable jar. When I start the *.jar file in linux and get the following error.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java2411 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1889) at java.lang.Runtime.loadLibrary0(Runtime.java:900) at java.lang.System.loadLibrary(System.java:1087)

Basically i have two question.
1. How can i get the loaded library path at runtime?
2. Is it possible that the chosen way is not the right way to handle the problem?

Thanks

2

2 Answers 2

1

One important this to keep in mind for loading linux libraries with System.loadLibrary, omit the lib prefix in the library name, for instance, if the library name is libxyz.so, your call would be:

System.loadLibrary("xyz");

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

Comments

0

Set the path of OpenCV in the variable LD_LIBRARY_PATH. You can do it in the shell where you run the "jar". Use export command.

2 Comments

Your answer opens new questions. 1 Do I let the native library location in the java build path in eclipse to value "none" before exporting the project as jar?
Take a look at this link: stackoverflow.com/questions/661320/…

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.