views:

213

answers:

2

We used an external library, specifically jmf.jar (Java Media Framework), for our java application which relies on images captured from the webcam. However, when we tried to package the application into a jar file, the application runs but once we try to access/open the webcam nothing happens.

We are using Eclipse and we used its export feature to create the jar file.

Does anybody know how to solve this?

A: 

You don't just need to export your project into a jar file; you need to create an "executable" jar file. This means that the manifest of the jar file is edited appropriately so that the classpath includes all required dependencies and the main class is set correctly.

In recent versions of Eclipse you can use the Runnable JAR File Export Wizard. Have also a look at the Fat Jar Eclipse Plug-in.

kgiannakakis
+1  A: 

Did you think to include jmf in the manifest of your jar ? See this link for more explanations here

Vincent Briard