java.lang.UnsatisfiedLinkError with iCommand

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

Moderators: 99jonathan, roger, imaqine

java.lang.UnsatisfiedLinkError with iCommand

Postby paulreiners » Tue Oct 16, 2007 11:00 pm

When running the following code:

Code: Select all
import lejos.nxt.Sound;
import icommand.nxt.comm.NXTCommand;

public class Beep {

   public static void main(String[] args) {
      NXTCommand.open();
      Sound.beep();
      System.out.println("Done playing tone.");

      NXTCommand.close();
   }
}


I'm getting the following error:

Properties location: C:\Documents and Settings\Administrator\icommand.properties
BlueCove version 2.0.0 on winsock
Exception in thread "main" java.lang.UnsatisfiedLinkError: playTone
at lejos.nxt.Sound.playTone(Native Method)
at lejos.nxt.Sound.systemSound(Sound.java:34)
at lejos.nxt.Sound.beep(Sound.java:71)
at Beep.main(Beep.java:19)
BlueCove stack shutdown completed


I believe my path is set correctly:

NXJ_HOME=C:\javaTools\lejos_NXJ_0_4_0beta\lejos_nxj
Path=C:\javaTools\lejos_NXJ_0_4_0beta\lejos_nxj\bin;[...]


What am I doing wrong here?
paulreiners
New User
 
Posts: 8
Joined: Sun Oct 07, 2007 12:20 am
Location: Minnesota

Postby bbagnall » Sat Oct 20, 2007 6:27 pm

Hi Paul,

Your code tries to use leJOS NXJ classes and then compile using iCommand (see your first line that imports a lejos class). The correct code should be:

Code: Select all
import icommand.nxt.Sound;
import icommand.nxt.comm.NXTCommand;

public class Beep {

   public static void main(String[] args) {
      NXTCommand.open();
      Sound.playTone(1000, 1000);
      System.out.println("Done playing tone.");

      NXTCommand.close();
   }
}


Note, the iCommand API doesn't have methods for beep(), etc... I'll try to add these for the next release so that it more closely shadows the leJOS NXJ API.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm


Return to NXJ Software

Who is online

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

more stuff