2014-06-29 51 views
2

我試圖讓JIntellitype與我的Java應用程序的功能,但我在下面的異常堅持:問題添加原生DLL文件的Java運行時(JIntellitype)

Exception in thread "AWT-EventQueue-0" com.melloware.jintellitype.JIntellitypeException: Could not load JIntellitype.dll from local file system or from inside JAR 
    at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:114) 
    at com.melloware.jintellitype.JIntellitype.getInstance(JIntellitype.java:177) 
    at marketbot.SettingsWindow.<init>(SettingsWindow.java:27) 
    at marketbot.MarketBot$2.run(MarketBot.java:129) 
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) 
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) 
    at java.awt.EventQueue.access$200(EventQueue.java:103) 
    at java.awt.EventQueue$3.run(EventQueue.java:694) 
    at java.awt.EventQueue$3.run(EventQueue.java:692) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) 
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) 
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) 
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) 
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) 
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) 
Caused by: java.io.IOException: FromJarToFileSystem could not load DLL: com/melloware/jintellitype/JIntellitype.dll 
    at com.melloware.jintellitype.JIntellitype.fromJarToFs(JIntellitype.java:150) 
    at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:105) 
    ... 17 more 
Caused by: java.lang.NullPointerException 
    at com.melloware.jintellitype.JIntellitype.fromJarToFs(JIntellitype.java:146) 
    ... 18 more 

我有這些DLL無處不在那裏應該是(說實話,我把它們放在了我能想象到的每個地方),而且我仍然無法實現它。它今天早些時候工作,但在電腦重新啓動後,我現在再次得到這個錯誤。我使用netbeans,所以我將JIntellitype JAR添加到項目庫中,並且在C:\ Windows \ System,主項目文件夾,src文件夾,dist文件夾,lib文件夾,java jdk jre bin文件夾中有DLLS (所有其他的dll都是這樣),而且似乎沒有任何東西能夠讓它起作用。

有沒有人有任何想法?

在我的谷歌任務中,我確實遇到過https://code.google.com/p/jintellitype/issues/detail?id=12&can=1&colspec=ID%20Type%20Status%20Priority%20Stars%20Owner%20Summary,但我無法得到這個幫助我。

+0

您可能想要提供試圖加載DLL的代碼 – MadProgrammer

+0

我只是使用JIntellitype庫...所以沒有自定義代碼運行,只是示例代碼基本上:https://code.google.com/p/jintellitype/ – Chris

回答

1

嗯,我不完全確定爲什麼,但我決定安裝Java x64,將我的環境切換到64位,並使用64位DLL,現在它可以完美工作。我猜〜魔術〜碰巧發生: -/

+0

發生了什麼事是,當你使用本機代碼時,你的代碼不像java那樣是跨平臺兼容的。所以你必須編譯或使用一個64位的DLL,然後使用一個32位的Java。 – Whirvis

0

我是作者。通常這意味着它找不到你的DLL,但你試圖讓我們的示例應用程序工作?你可以在這裏下載示例:

https://code.google.com/p/jintellitype/downloads/list

也是您使用的是64位JVM?如果是這樣,你需要確保你使用64位Intellitype.DLL並重命名爲JIntellitype.dll

+0

感謝您的迴應!不,該示例應用程序無法正常工作,並因相同的錯誤而失敗。如果我嘗試手動加載DLL(因爲JIntellitype.jar不通過其捕獲顯示實際的錯誤消息),我得到一個初始化錯誤:「System.load(」C:\\ Users \\ Christopher \\ Desktop \\ jintellitype-1.3.9-DIST \\ jintellitype-1.3.9 \\ JIntellitype.dll 「);」會產生「動態鏈接庫(DLL)初始化例程失敗」,同時加載64位版本會產生:「無法在IA 32位平臺上加載AMD 64位.dll」。所以在初始化dll失敗 – Chris