Ask Your Question

I can not run the Java using Opencv on Linux, 64bit

asked 2013-11-18 21:26:46 -0500

mossi gravatar image

Hi. I want to develop Java Program using OpenCv on Linux, 64bit. So I can install the OpenCv,2.4.4 for Linux. And I can compile the Sample Program using OpenCv. But When I try to run the program, I got the following error message. Exception in thread "main" java.lang.UnsatisfiedLinkError: /mnt/sdc/yu/opencv-2.4.4/build/bin/ /mnt/sdc/yu/opencv-2.4.4/build/bin/ wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

I think this error means the OpenCv Library is for 32bit PC, but I am running the program on 64bit PC. I want to run the program on 64bit. What should I do? I look forward to hearing from you. Sincerely.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-11-19 18:06:21 -0500

updated 2013-11-19 18:07:12 -0500

You can easily compile OpenCV yourself, and get 64-bit libraries. I just did that with 2.4.7:


(update to suit your needs)

And then:

make -j4

edit flag offensive delete link more


Thank you for your answer. But it didn't work. I can compile my java file, but when I try to run, it did't work.

The command I input is below.

tar zxvf opencv-2.4.7

cd opencv-2.4.7

mkdir build

cd build


sudo make -j4

javac -cp bin/opencv-247.jar

java -Djava.library.path=lib Main

Then I got the error below /mnt/sdc/yu/opencv-2.4.7/build/lib/ /mnt/sdc/yu/opencv-2.4.7/build/lib/ wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

Does anyone have any idea what should I do? I'm looking forward to hearing from you. Sincerely.

mossi gravatar imagemossi ( 2013-11-19 23:47:02 -0500 )edit

Just now, I could run the program, thank you for your advise. Actually, the Java on my machine was 32bit, not 64bit. So I installed the java for 64bit, then I could run the program. I spent three days for solving this problem, but I am relieved to run the program. Thank you.

mossi gravatar imagemossi ( 2013-11-20 04:37:50 -0500 )edit

Question Tools


Asked: 2013-11-18 21:26:46 -0500

Seen: 883 times

Last updated: Nov 19 '13