Ask Your Question
0

Can't find opencv-249.jar file

asked May 28 '14

Alejandro Silvestri gravatar image

updated May 28 '14

berak gravatar image

Recently downloaded and installed OpenCV 2.4.9 on Ubuntu 14 (decompress, cmake, make, install). Now I'm following "Using OpenCV Java with Eclipse" tutorial http://docs.opencv.org/doc/tutorials/introduction/java_eclipse/java_eclipse.html

It refers to C:\OpenCV-2.4.6\build\java\opencv-246.jar (of course, this example is about opencv version 2.4.6 on Windows), but I can't find the jar file in the drive, not even the "build" subdir in the uncompressed directory.

Any hint? Thank you

Preview: (hide)

Comments

1

check the cmake output again. it should look similar to this(sorry, windows again):

  Java:
    ant:                         E:/app/bin/ant.bat (ver 1.9.1)
    JNI:                         D:/Programme/Java/jdk1.6.0_16/include D:/Programme/Java/jdk1.6.0_16/include/win32 D:/Programme/Java/jdk1.6.0_16/include
    Java tests:                  NO

you will need ant installed before

berak gravatar imageberak (May 28 '14)edit
1

Thanks berak, you gave me the starting point to investigate. It turned out that it's needed to have JAVA_HOME environmental variable set (and pointing to jdk home directory) before running cmake. After "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" (in my case, of course), cmake generated both: build/bin/opencv-249.jar build/lib/libopencv_java249.so

My only remaining issue is that "make install" didn't copy these files to any place (like usr/local/lib or else), so I can't remove the original opencv directory.

I think I'll post a new question about it. Thank you very much.

1 answer

Sort by » oldest newest most voted
0

answered Jun 1 '14

Alejandro Silvestri gravatar image

It's needed to have JAVA_HOME environmental variable set (and pointing to jdk home directory) before running cmake. After

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

(path may differ in your system), cmake generated both:

build/bin/opencv-249.jar
build/lib/libopencv_java249.so

Note: 'build'is the temp file where I run cmake and make. make install didn't copy these files to anywhere.

Preview: (hide)

Comments

Hi, i tried what u said but the results are the same..(i.e., no jar file) i have few doubts in mind 1) should ant be installed in the system? 2) what are the options to be used while using cmake command? 3) I am installing opencv-3.0.0 .. can version be a problem?

If u can help in any way...Thanks!!

Sbmsgl gravatar imageSbmsgl (Oct 10 '14)edit

I found out "ant" should be installed to get .jar and .so files in the respective directories ...

Sbmsgl gravatar imageSbmsgl (Oct 10 '14)edit

also files(both opencv-300.jar and libopencv_java300.so) are copied to /usr/local/share/OpenCv/java(in my case) directory during make install.

Sbmsgl gravatar imageSbmsgl (Oct 10 '14)edit

Question Tools

Stats

Asked: May 28 '14

Seen: 6,578 times

Last updated: Jun 01 '14