我有使用JNA並獲取音頻和視頻的應用程序。它在我的Linux機器中運行。但是,當我在Windows中測試它。它只是從來沒有工作。因爲我還在學習,所以我會很感激你的建議,如何解決它,我已經花了幾天和幾周才解決,但沒有得到這個爲什麼JAVA不能簡單地工作,它是一個跨平臺。爲什麼它應該再次需要系統路徑或其他配置。如何解決這個JNA問題?
我現在完全失去了,它爲什麼在Linux中起作用,它在Windows XP中不起作用?我怎樣才能運行它呢?
Inside the lib direcotry i have my JNA and Audio libraries.
C:\Documents and Settings\test\Desktop\test>dir
Volume in drive C has no label.
Volume Serial Number is 680F-0963
Directory of C:\Documents and Settings\test\Desktop\test
19/12/2010 22:09 <DIR> .
19/12/2010 22:09 <DIR> ..
19/12/2010 22:09 51.791 Audio.jar
19/12/2010 22:09 <DIR> lib
1 File(s) 51.791 bytes
3 Dir(s) 487.002.112 bytes free
Now trying to run Audio.jar, gets Fail 1:
C:\Documents and Settings\test\Desktop\test>java -Djava.library.path=~/jni -jar
Audio.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load librar
y gstreamer-0.10
at org.gstreamer.lowlevel.GNative.loadWin32Library(GNative.java:83)
at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:43)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
at org.gstreamer.Gst.<clinit>(Gst.java:59)
at video.MyVideo.simpletest(MyVideo.java:31)
at sipphone.MainApplet.run(MainApplet.java:58)
at sipphone.MainApplet.main(MainApplet.java:43)
Fail 2:
C:\Documents and Settings\test\Desktop\test>java -Djna.library.path=. -jar Audio
.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load librar
y gstreamer-0.10
at org.gstreamer.lowlevel.GNative.loadWin32Library(GNative.java:83)
at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:43)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
at org.gstreamer.Gst.<clinit>(Gst.java:59)
at video.MyVideo.simpletest(MyVideo.java:31)
at sipphone.MainApplet.run(MainApplet.java:58)
at sipphone.MainApplet.main(MainApplet.java:43)
我可能會說明顯然,但是您是否還記得爲Windows構建庫?那麼,你的'lib'目錄中是否有'gstreamer-0.10.dll'? – 2010-12-20 18:28:35
這就是我在lib目錄中的C:\ Documents and Settings \ test \ Desktop \ test \ lib 19/12/2010 22:09
我對gstreamer並不熟悉,但從第一印象來看,您應該以某種方式在您的Windows機器上安裝GStream,並指出'jna.library .path'(可能不是'java.library.path')到它保存DLL的位置。那,或者一起發運DLL。 – 2010-12-20 18:55:19