开发者

NetBeans JMF project deployment

I used JMF/Webcam Frame Grabber Demo to create java desktop application in NetBeans 7.0.1 EE that grabs frame from my webcam. Application works fine if I run it from NetBeans (Right click on project and Run), but if I run Netbeans generated .jar file from command prompt, It doesn't detect my device.

CaptureDeviceInfo device = CaptureDeviceManager.getDevice(cameraDevice);

device is null.

The result is the same if I remove jmf.jar from project library and run it from there. It throws this exception:

Exception in thread "Thread-4" java.lang.NullPointerException
    at desktopapplication6.DesktopApplication6View$MyNetworkThread.run(DesktopApplication6View.java:248)

Netbeans creates dist and dist\lib folder with all the necessary lib jars. In the applications jar, Manifest.mf looks like this

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_27-b07 (Sun Microsystems Inc.)
Class-Path: lib/appframework-1.0.3.jar lib/swing-worker-1.1.jar lib/jm
 f.jar
Main-Class: desktopapplication6.DesktopApplication6

I tried creating my own jar with changes in manifest, but no luck.

I'm using Win 7 64bit, JDK 32bit v.1.6.0_27. (NetBeans use the same JDK), JMF installed after that (v.2.1.1e).

Classpath = %JMFHOME%\lib\jmf.jar;%JMFHOME%\lib\sound.jar;%JMFHOME%\lib
Path = %JMFHOME%\lib
JMFHOME = C:\Program Files (x86)\JMF2.1.1e

JMFRegistry detects my device (vfw:Microsoft WDM Image Capture (Win32):0). So, does anyone know how to make this开发者_如何学Go jar file that works and recognize my device?


The jmf.properties file needs to go in the same folder as the class that has your main method or the same folder as the JAR archive that contains the main method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜