3

我一直在尝试使用 LeJOS 库与我的 NXT 机器人生成接口。当我运行代码时,控制台打印出以下错误:

lejos.pc.comm.NXTCommException: Cannot load NXTComm driver at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:110) at lejos.pc.comm.NXTCommFactory.createNXTComm(NXTCommFactory.java:91) at com.thirteenbit.prasController.PrasController.initConnection(PrasController.java:24) at com.thirteenbit.prasController.PrasController.<init>(PrasController.java:17) at com.thirteenbit.prasController.PrasController$1.run(PrasController.java:42) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708) at java.awt.EventQueue.access$400(EventQueue.java:82) at java.awt.EventQueue$2.run(EventQueue.java:669) at java.awt.EventQueue$2.run(EventQueue.java:667) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:678) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: lejos.internal.jni.JNIException: cannot load library /Users/Andrew/Desktop/Dropbox/Eclipse Files/leJOS_NXJ_0.9.1beta-3/lib/pc/native/macosx/libjfantom.jnilib, architecture macosx/x86_64 at lejos.internal.jni.JNILoader.loadLibrary(JNILoader.java:121) at lejos.pc.comm.NXTCommFantom.initialize0(NXTCommFantom.java:96) at lejos.pc.comm.NXTCommFantom.initialize(NXTCommFantom.java:103) at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:103) ... 18 more Caused by: java.lang.UnsatisfiedLinkError: /Users/Andrew/Desktop/Dropbox/Eclipse Files/leJOS_NXJ_0.9.1beta-3/lib/pc/native/macosx/libjfantom.jnilib: no suitable image found. Did find: /Users/Andrew/Desktop/Dropbox/Eclipse Files/leJOS_NXJ_0.9.1beta-3/lib/pc/native/macosx/libjfantom.jnilib: no matching architecture in universal wrapper at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703) at java.lang.Runtime.load0(Runtime.java:770) at java.lang.System.load(System.java:1020) at lejos.internal.jni.JNILoader.loadLibrary(JNILoader.java:111) ... 21 more

我相信这与在java eclipse 中发现的问题相同: failed to load nxt usb comm driver,并且我安装了 eclipse 32 位版本,但仍然遇到相同的错误,即上述错误。我将如何解决这个问题?

4

1 回答 1

1

因为我的声誉(我是新人)无法发表评论,所以回答:
您应该确保您拥有:
- x86 JDK(Java 开发工具包),点击:jdk-7u21-windows-i586.exe
- Lego fantom驱动程序,单击:Fantom Driver 1.1.3
和您已经提到的 32 位版本的 Eclipse

于 2013-05-05T17:28:30.663 回答