views:

150

answers:

3

I downloaded and installed a fat-jar eclipse plug-in to be able to package my project containing an external library(JMF). But when I run the application, it says "No device found". Does this mean that jmf.jar wasn't included in the new jar file since it can't detect the webcam? Because when I'm running the application in eclipse, there is no error and it can detect the webcam without any trouble.

How can i solve this problem?

+2  A: 

No, "No device found" is a typical JMF response - it can't seem to find a video/audio input or output device. So I think JMF is indeed in your jar and is simply complaining.

Is it possible something is missing from your packed-up classes? Something that is on the classpath in Eclipse but not included in your big jar?

Update

I just remembered where the problem may be: For performance reasons etc, JMF uses native code; installing JMF installs DLL's (Windows) or .so's (Linux/Mac?). I'd guess that JMF is having some trouble finding these components when you make such far-reaching changes to its classpath.

I believe there's also a software emulation driver available. Can you try working with that and seeing if it works OK from the jar?

Carl Smotricz
A: 

It may be that fatjar uses static code analysis to figure out what class files wind up in the generated JAR, and that the JMF is doing dynamic techniques to load classes from other jars based on a registry of some sort. One way to find out is to run your application with the -verbose:class switch, and then sift through the output to see which class or classes failed to load.

Jonathan Feinberg
A: 

I found a post in the Sun forums where someone else was having trouble with JMF. One responder suggested:

try FMJ (http://www.fmj-sf.net/) or gstreamer-java (http://code.google.com/p/gstreamer-java/).

It's possible (though of course hardly guaranteed) that switching media framework products could be a solution.

Carl Smotricz