Hi,
I am unable to use the IR tower in my own code.
firmdl works fine but my code did not.

import java.io.IOException;
import java.io.OutputStream;

import josx.rcxcomm.*;


public class BaseStation
{
        public static void main(String[] args)
        {
                int     IR_PING =       0x0001;
                int     i = 0;
                
                System.out.print("send ping: ");
                while(true)
                {
                        i++;

                        try
                        {
                                RCXPort port = new RCXPort();

                                OutputStream ir_stream = 
port.getOutputStream();
                        
                                ir_stream.write(IR_PING);
                                ir_stream.flush();
                        }
                        catch (IOException ioe)
                        {
                                ioe.printStackTrace();
                        }
                        
                        if((i > 0) && (i % 60) == 0)
                                System.out.println("");
                        System.out.print(".");
                }
    }
}

You see the code is simple and I tried this:
[EMAIL PROTECTED]:~/eclipse/BaseStation> javac 
-classpath /home/thomas/Lehre/Robotik/lejos/lib/pcrcxcomm.jar 
BaseStation.java

[EMAIL PROTECTED]:~/eclipse/BaseStation> java BaseStation
send ping: Exception in thread "main" java.lang.UnsatisfiedLinkError: init
        at josx.rcxcomm.LLC.init(Native Method)
        at josx.rcxcomm.LLCHandler.<init>(LLCHandler.java:18)
        at josx.rcxcomm.RCXPort.<init>(RCXPort.java:18)
        at BaseStation.main(BaseStation.java:21)


And also (library path set directly):

[EMAIL PROTECTED]:~/eclipse/BaseStation> java 
-Djava.library.path="$LEJOS_HOME/bin" 
-classpath "$LEJOS_HOME/lib/commons-cli-1.0.jar:$LEJOS_HOME/lib/jtools.jar:
$LEJOS_HOME/lib/pcrcxcomm.jar" BaseStation
Exception in thread "main" java.lang.NoClassDefFoundError: BaseStation

Can someone give me a hint.. I am clueless? :-\

Thanks
Tom
-- 
Tom <[EMAIL PROTECTED]>
fingerprint = F055 43E5 1F3C 4F4F 9182  CD59 DBC6 111A 8516 8DBF


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Lejos-discussion mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion

Reply via email to