A question about java opencv jni [closed]

asked 2015-08-25 00:13:05 -0500

We know that we are provided a java interface like Java249.jar and a dynamic link file like dll files in Windows .I think that it doesn't matter whether i have configured the c++ Opencv in my OS. Because the java program calls the dll not the primal c++ opencv. So i don't need to install Opencv c++ if i just want to use it in java. I only need two files(.jar and .dll ).It's that right? Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2015-08-25 03:41:14.538409



unfortunately, to link the native dll against the opencv code, you need to have opencv with c++ configured.

berak gravatar imageberak ( 2015-08-25 00:51:42 -0500 )edit

can you tell me the reason? i know that the c++ environment is needed.but why must i install opencv with c++?is the dll for java will call the dlls for c++?

ccbreeze gravatar imageccbreeze ( 2015-08-25 00:57:58 -0500 )edit

if you have jni c++ code, and want to compile that, you need a compiler, right ?

if that code is dependant on opencv, you will have to link it against opencv libs, right ?

maybe you were asking: "do i have to rebuild opencv from src for this" ? - not if you have the same compiler, your opencv libs were build with.

berak gravatar imageberak ( 2015-08-25 01:08:53 -0500 )edit

OK,I got it. of course a c++ cmpiler is needed.You said that the code is dependant on opencv and i just wanted this fact.You means that the dll for java is just like an interface,not the all code.it have to call other dlls. I have thought that all needed native code is writen in this only dll. Because i know some small projects i can do like this. Have i understood what you said? Thanks a lot

ccbreeze gravatar imageccbreeze ( 2015-08-25 01:20:13 -0500 )edit

yes, i think, you got the connection now.

btw, setting up a project in e.g. vs is almost the same for jni as any other opencv demo (like the displayimage.cpp) - the only difference is, you're building a dll, not an exe.

berak gravatar imageberak ( 2015-08-25 01:23:46 -0500 )edit

ok, it's clear now

ccbreeze gravatar imageccbreeze ( 2015-08-25 01:40:24 -0500 )edit