I am installing OpenCv using these steps:

Building OpenCV from Source Using CMake, Using the Command Line
Create a temporary directory, which we denote as <cmake_binary_dir>, where you want to put the generated Makefiles, project files as well the object files and output binaries.

Enter the <cmake_binary_dir> and type

cmake [<some optional parameters>] <path to the OpenCV source directory>
For example

cd ~/opencv
mkdir release
cd release
Enter the created temporary directory (<cmake_binary_dir>) and proceed with:

make **<--- Errors here**
sudo make install


Once I type "make" I get this error:


[ 87%] Build Java tests
Buildfile: /home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/build.xml


    [javac] Compiling 104 source files to /home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/build/classes

/home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/build.xml:55: The following error occurred while executing this line:
/home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/build.xml:19: /home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/lib does not exist.

Total time: 0 seconds
make[2]: *** [modules/java/test/.build/build/jar/opencv-test.jar] Error 1
make[1]: *** [modules/java/test/CMakeFiles/opencv_test_java.dir/all] Error 2
make: *** [all] Error 2

I am stuck. Please help.

Recommended Answers

All 4 Replies

You need to create this file: /home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/lib
The configuration and make tools should have created it, but see what happens when you create it yourself, then try make again.

Okay I created that directory. Now I get a compilation error.

/home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/build.xml:55: The following error occurred while executing this line:
/home/svenson/CSci591/OpenCV-2.4.4/release/modules/java/test/.build/build.xml:19: Compile failed; see the compiler error output for details.

Total time: 1 second
make[2]: *** [modules/java/test/.build/build/jar/opencv-test.jar] Error 1
make[1]: *** [modules/java/test/CMakeFiles/opencv_test_java.dir/all] Error 2
make: *** [all] Error 2

I'm encountering this same error. After creating that directory, the error make spits out is that for some reason the java tests can't find junit:

[javac] /Users/greg/Downloads/OpenCV-2.4.4/build/modules/java/test/.build/src/org/opencv/test/OpenCVTestCase.java:16: package junit.framework does not exist

I've tried downloading junit and adding it to my classpath to no avail. I've also looked for a cmake flag to skip building the java tests, but I can't find one. It seems like the answer may be altering the build.xml file in someway, but I know nearly nothing about java build schemes, so I don't really know where to start.

Hi Guys, i get same issue here. But i can resolv this, downloading and copying junit latest version jar in OpenCV-2.4.4/build/modules/java/test/.build/lib and OpenCV-2.4.4/build/modules/java/lib. Works fine and now i can use java to work in my project!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.