eclipse - webcam problems with raspberry pi (java): ClassNotFoundException -
we struggling getting control on webcam in java on raspberry. try many ways , 1 seems best use sarxos webcam capture api. add project:
- bridj-0.7-20140918.jar
- webcam-capture-0.3.12-20161206.184756-3.jar
then try test (the following code) send error message. please need :)
import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import com.github.sarxos.webcam.webcam; /** * example of how take single picture. * * @author bartosz firyn (sarxos) */ public class webcam { public static void main(string[] args) throws ioexception { // default webcam , open webcam webcam1 = webcam.getdefault(); webcam1.open(); // image bufferedimage image = webcam1.getimage(); // save image png file imageio.write(image, "png", new file("test.png")); } }
our error:
exception in thread "main" java.lang.noclassdeffounderror: org/slf4j/loggerfactory @ com.github.sarxos.webcam.webcam.<clinit>(webcam.java:101) @ webcam.main(webcam.java:21) caused by: java.lang.classnotfoundexception: org.slf4j.loggerfactory @ java.net.urlclassloader$1.run(urlclassloader.java:359) @ java.net.urlclassloader$1.run(urlclassloader.java:348) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:347) @ java.lang.classloader.loadclass(classloader.java:425) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:312) @ java.lang.classloader.loadclass(classloader.java:358) ... 2 more
you need add slf4j-api-1.7.25.jar
, slf4j-simple-1.7.25.jar
file class path. can download below link , put lib
directory , add java build path
.
1) slf4j-api-1.7.25.jar click here
2)slf4j-simple-1.7.25.jar click here
Comments
Post a Comment