jfantom.dll for x64

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

jfantom.dll for x64

Postby ekrekeler » Tue Mar 19, 2013 12:14 am

I am using the 64-bit version of Eclipse IDE, have LeJOS NXJ 0.9.1 beta 3 Installed, and am using 32-bit JDK 1.7.0 update 17 on a Windows 7 Home Premium x 64-bit laptop. I have jfantom.dll installed to the LeJOS NXJ\lib\pc\native\windows\x86\ directory, but I do not have it for x86_64. When I try to run a LeJOS project in Eclipse, with the NXT Brick connected via USB and turned on, it gives me this error:

Code: Select all
Linking ...
Program has been linked successfully
Uploading ...
leJOS NXJ> Error: Failed to load USB comms driver.
leJOS NXJ> Caused by lejos.pc.comm.NXTCommException: Cannot load NXTComm driver
leJOS NXJ>    at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:110)
leJOS NXJ> Caused by lejos.internal.jni.JNIException: library jfantom.dll was not found in C:\Program Files (x86)\Java\LeJOS NXJ\lib\pc\native, architecture windows/x86_64
leJOS NXJ>    at lejos.internal.jni.JNILoader.loadLibrary(JNILoader.java:127)
leJOS NXJ> Searching for any NXT using Bluetooth inquiry
Native Library intelbth_x64 not available
Native Library bluecove_x64 not available
leJOS NXJ> Error: Search failed.
leJOS NXJ> Caused by lejos.pc.comm.NXTCommException: Bluetooth stack not detected
leJOS NXJ>    at lejos.pc.comm.NXTCommBluecove.search(NXTCommBluecove.java:54)
leJOS NXJ> Caused by javax.bluetooth.BluetoothStateException: BlueCove libraries not available
leJOS NXJ>    at com.intel.bluetooth.BlueCoveImpl.createDetectorOnWindows(BlueCoveImpl.java:896)
No NXT found - is it switched on and plugged in (for USB)?
leJOS NXJ> Failed to find any NXTs
leJOS NXJ> Failed to connect to any NXT
uploading the program failed with exit status 1



Then, when I copy the jfantom.dll from the x86 folder to the x86_64 folder, it gives me this error:

Code: Select all
Linking ...
Program has been linked successfully
Uploading ...
leJOS NXJ> Error: Failed to load USB comms driver.
leJOS NXJ> Caused by lejos.pc.comm.NXTCommException: Cannot load NXTComm driver
leJOS NXJ>    at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:110)
leJOS NXJ> Caused by lejos.internal.jni.JNIException: cannot load library C:\Program Files (x86)\Java\LeJOS NXJ\lib\pc\native\windows\x86_64\jfantom.dll, architecture windows/x86_64
leJOS NXJ>    at lejos.internal.jni.JNILoader.loadLibrary(JNILoader.java:121)
leJOS NXJ> Caused by java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Java\LeJOS NXJ\lib\pc\native\windows\x86_64\jfantom.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
leJOS NXJ>    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
leJOS NXJ> Searching for any NXT using Bluetooth inquiry
Native Library intelbth_x64 not available
Native Library bluecove_x64 not available
leJOS NXJ> Error: Search failed.
leJOS NXJ> Caused by lejos.pc.comm.NXTCommException: Bluetooth stack not detected
leJOS NXJ>    at lejos.pc.comm.NXTCommBluecove.search(NXTCommBluecove.java:54)
leJOS NXJ> Caused by javax.bluetooth.BluetoothStateException: BlueCove libraries not available
leJOS NXJ>    at com.intel.bluetooth.BlueCoveImpl.createDetectorOnWindows(BlueCoveImpl.java:896)
leJOS NXJ> Failed to find any NXTs
leJOS NXJ> Failed to connect to any NXT
No NXT found - is it switched on and plugged in (for USB)?
uploading the program failed with exit status 1



Is there a way I can get a jfantom.dll that supports 64-bit architecture? Also, it would also work if I could get my bluetooth working. I have an Intel® Centrino® Wireless-N 1030. Why can't I get it to recognize intelbth_x64 or bluecove_x64? I know I have bluecove.jar located in lib/pc/3rdparty, but it's still not recognizing it.


Also, all this is using the run button, not the external tools. Do I have to use the external tools, because it works when I do that.
User avatar
ekrekeler
New User
 
Posts: 2
Joined: Sun Mar 17, 2013 4:57 am
Location: United States

Re: jfantom.dll for x64

Postby gloomyandy » Tue Mar 19, 2013 11:21 am

Not possible sorry. The toolkit (from Lego/NI) that we have to link with to talk to the Lego driver is only available as a 32bit version. So you need to run a 32bit VM when running PC side leJOS applications and tools. Not sure if with 64bit Eclipse you can still use a 32bit VM to run the leJOS parts. Sven may have a better idea than I do on that...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3003
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: jfantom.dll for x64

Postby ekrekeler » Wed Mar 20, 2013 12:35 am

gloomyandy wrote:Not possible sorry. The toolkit (from Lego/NI) that we have to link with to talk to the Lego driver is only available as a 32bit version. So you need to run a 32bit VM when running PC side leJOS applications and tools. Not sure if with 64bit Eclipse you can still use a 32bit VM to run the leJOS parts. Sven may have a better idea than I do on that...


Thanks. I just decided to use the External tools in Eclipse, and it works fine. Also, does lejos support .rso files? I uploaded some to my NXT using FileSystem.upload(rsoFile); and then I tried to play them using Sound.playSoundFile(rsoFile.getName()); , but alas, all I got were three consecutive beeps increasing in tone. I'm not sure what to make of this.

This is the code I used, modified from its original source (Found in the book Maximum Lego NXT: Building Robots with Java Brains by Brian Bagnall, to support the current LeJOS NXJ PC API.

Code: Select all
import lejos.nxt.*;
import lejos.nxt.remote.NXTCommand;

import java.io.*;

public class SpeechSynthesis {
   static File freettsdir = new File("C:/Program Files (x86)/Java/FreeTTS v1.2.2");
   static File converttool = new File(freettsdir + "/wavrsocvt.exe");
   
   static String WAVNAME = "temp.wav";
   static String RSONAME = "temp.rso";
   
   static NXTCommand commander;
   
   public static void say(String sentence) {
      
      String execString = "java -jar lib/freetts.jar -dumpAudio " + WAVNAME + " -text ";
      try {
         Process p = Runtime.getRuntime().exec(execString + sentence,null,freettsdir);
         p.waitFor();
         p = Runtime.getRuntime().exec(converttool + " " + WAVNAME + " -O=\"" + freettsdir +"\"",null,freettsdir);
         p.waitFor();
      } catch (Exception e) {
         System.out.println("Exceptioon: " + e);
      }
      File rsoFile = new File(freettsdir + "/" + RSONAME);
      byte status = FileSystem.upload(rsoFile);
      if(status == 0)
         System.out.println("File successfully uploaded");
      else {
         System.out.println("Error uploading " + rsoFile.getName() + ": " + Integer.toHexString(status));
         return;
      }
      rsoFile.delete();
      Sound.playSoundFile(rsoFile.getName());
      System.out.println(rsoFile.getName());
      do {} while(FileSystem.delete(rsoFile.getName())!=0);
   }
   
   public static void main(String[] args) {
      SpeechSynthesis.say("PLEASE PUT DOWN YOUR WEAPON");
      SpeechSynthesis.say("YOU HAVE 20 SECONDS TO COMPLY");
      SpeechSynthesis.say("YOU NOW HAVE 15 SECONDS TO COMPLY");
   }
   
}
User avatar
ekrekeler
New User
 
Posts: 2
Joined: Sun Mar 17, 2013 4:57 am
Location: United States

Re: jfantom.dll for x64

Postby gloomyandy » Wed Mar 20, 2013 9:32 am

Hi,
If you want to run all of your Java code on the PC then you may be able to use the standard Lego firmware on the NXT in which case you can use .rso files (which is what this sample does).

However the leJOS firmware does not support .rso files, but it does support .wav files. See the following post for the format we use:
viewtopic.php?p=4058#p4058

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3003
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 1 guest

more stuff