0

I have installed the Javacv jar file here : http://www.java2s.com/Code/Jar/j/Downloadjavacvjar.htm

After extracting the zip file I put the .jar file in the ext folder located inside the jre folder.

But whenever i try to run a code like this after importing the proper libraries

IplImage img;

  while (true) {

   //inser grabed video fram to IplImage img
   img = grabber.grab();

   //Set canvas size as per dimentions of video frame.
   canvas.setCanvasSize(grabber.getImageWidth(), grabber.getImageHeight()); 

   if (img != null) {      
     //Flip image horizontally
     cvFlip(img, img, 1);
    //Show video frame in canvas
    canvas.showImage(img);               
    }

i get an error like this :

error: cannot access Pointer

   if (img != null) {      

class file for com.googlecode.javacpp.Pointer not found

Akk
  • 53
  • 12
  • I'm not showing the rest of the code since that's not the problem – Akk Nov 26 '18 at 17:51
  • Are u using an IDE? You might need to add it to the classpath – Hongyu Wang Nov 26 '18 at 17:54
  • I'm using sublime text 3. It works with other jar files like the asprise OCR jar file – Akk Nov 26 '18 at 18:25
  • How are you running the code? – Hongyu Wang Nov 26 '18 at 18:29
  • I created a tool that makes me compile and run the code in the windows 10 command prompt that goes like this { "cmd": ["javac", "$file_name","&&","start","cmd","/k","java", "$file_base_name"], "path":"C\\programmi\\jdk1.8.0_181\\bin", "shell": true } – Akk Nov 26 '18 at 18:45
  • Look into this answer: https://stackoverflow.com/questions/2096283/including-jars-in-classpath-on-commandline-javac-or-apt – Hongyu Wang Nov 26 '18 at 19:42
  • Unfortunately after making a new sublime-build (and adding the class path leading to the jars and the main methods) it still give me the same error – Akk Nov 27 '18 at 17:52

0 Answers0