Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
927 views
in Technique[技术] by (71.8m points)

windows - adding openCV to java buildpath in eclipse

I have problems adding openCV to the buildpath of my eclipse-project. I have followed the instructions in the tutorial on this site: http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html#create-a-simple-java-project-in-eclipse

But executing the code fragment gives this console output:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv-java2.4.4 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at camStatisticsTests.RawTests.main(RawTests.java:20)

What do I have to do in order to get openCV working with java and eclipse. i want to use it as a normal java library.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had the same problem.

It happened because I had a mistake with the 'Native library location' configuration:

Goto Eclipse -> Window -> Preferences:

Goto Eclipse -> Window -> Preferences

Goto User Libraries:

enter image description here

Make sure that your native library location path is (change c:/opencv-2.4.9 to your own opencv folder):

C:/opencv-2.4.9/build/java/x64

and not:

C:/opencv-2.4.9/build/x64

(I missed the /java folder...)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...