Ask Your Question
0

How we import OpenCV in java while using no compiler just Notepad?

asked 2017-11-29 13:17:24 -0600

fahad_nadeem gravatar image

Its first time I am using OpenCV, I am in learning period, I just want to know how to import OpenCV in java while we are not using any of the Compiler just simple Editor, like I m using Atom. Please Explain

edit retag flag offensive close merge delete

Comments

you do have a java sdk ? (you need the javac command)

also, os, opencv version ?

berak gravatar imageberak ( 2017-11-29 13:24:16 -0600 )edit

Yes I have SDK, also have opencv 3.3.1

fahad_nadeem gravatar imagefahad_nadeem ( 2017-11-29 13:33:34 -0600 )edit

do yourself a favour, and get the ant tool, then use it just like here

that's still assuming, that the prebuild packages have prebuild java wrappers , i'm not sure about that.

do you see a opencv_java331.dll or a opencv-java.jar anywhere there ?

berak gravatar imageberak ( 2017-11-29 14:38:02 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-11-30 01:08:28 -0600

BAHRAMUDIN ADIL gravatar image

updated 2017-12-01 23:05:45 -0600

It is simple, you can do it like this:

Warn: before you go to next step, first ensure that you already have Java installed and it is present in your environment path. And also you have the OpenCV native lib in your environment path

  1. javac -cp .:path/to/opencv3xx.jar YourJavaFile.java If everything goes well, then it will generate .class files, then:
  2. java -cp .:path/to/opencv3xx.jar YourJavaFile.class here .class extension is optional.

And it is that.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-11-29 13:17:24 -0600

Seen: 325 times

Last updated: Dec 01 '17