3

I have been trying to generate an interface with my NXT robot, using the LeJOS libraries. When I run the code I get the following error printed to the console:

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

I believe that this is identical to the problem found in java eclipse: failed to load nxt usb comm driver, and I installed eclipse 32-Bit version and I still am getting the same error, the one above. How would I go about fixing this?

Community
  • 1
  • 1
Andrew Gies
  • 719
  • 8
  • 20

1 Answers1

1

Because I can't post comments due to my reputation (I'm new), an answer:
You should make sure you have:
- x86 JDK (Java Development Kit), click: jdk-7u21-windows-i586.exe
- Lego fantom drivers , click: Fantom Driver 1.1.3
and as you already mentioned a 32-Bit version of Eclipse

Rob
  • 51
  • 11
  • 1
    I am running Mac and the x86 version isn't in that list. There is a x64 version, though. I'm sorry I don't have much experience on things like this. If you have the time I would love a full description. Thanks. – Andrew Gies May 08 '13 at 15:18
  • I have no knowledge at all of mac's and how to set up Java on it, so I'll try: – Rob May 08 '13 at 22:55
  • First you need to (re)install the Fantom Driver 1.1.3 as mentioned earlier. I see there's no x86 JDK version for Mac, so the x64 version cannot be your problem. In order to be able to help you, I first need to know which java-related programmes you've already installed and whether you've set up the environment variables (so lejos knows the directories of the JDK and the like). – Rob May 08 '13 at 23:03
  • Ok thanks. I'll try that. Do you know anything about the LeJOS android bluetooth support? Thanks again! @Rob – Andrew Gies May 13 '13 at 17:04
  • Ok, please report back the results. Yes, I've succesfully set up bluetooth communication between a NXT running LeJOS and a phone running Android a while ago. If you don't know where to start, just by reading all available information on Stackoverflow about how to set up a connection, I managed to get it working myself. – Rob May 14 '13 at 17:31