lejos 3.0 on ubuntu 9.10 [solved]

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

Moderator: roger

lejos 3.0 on ubuntu 9.10 [solved]

Postby JavaMan » Fri Dec 04, 2009 9:24 pm

Hello everyone,
After some searching on the forums, it appears that my problem is quite frequent, but I can't seem to get it solved. I am running JDK6 on Ubuntu 9.10 64bit. I have set up everything like the lejos 3.0 README said, but when I go to run checkDistribution.sh I get this:
Code: Select all
bits@bits-laptop:~/lejos/check$ ./checkDistribution.sh
checking environment
environment seems to be ok
compiling test class
linking and downloading test class
linking...
Signature 0: main([Ljava/lang/String;)V
Signature 1: run()V
Signature 2: <init>()V
Signature 3: <clinit>()V
Signature 4: notify()V
Signature 5: notifyAll()V
Signature 6: wait()V
Signature 7: wait(J)V
Signature 8: start()V
Signature 9: yield()V
Signature 10: sleep(J)V
Signature 11: currentThread()Ljava/lang/Thread;
Signature 12: getPriority()I
Signature 13: setPriority(I)V
Signature 14: interrupt()V
Signature 15: interrupted()Z
Signature 16: isInterrupted()Z
Signature 17: setDaemon(Z)V
Signature 18: isDaemon()Z
Signature 19: join()V
Signature 20: join(J)V
Signature 21: currentTimeMillis()J
Signature 22: exit(I)V
Signature 23: freeMemory()J
Signature 24: totalMemory()J
Signature 25: getMessage()Ljava/lang/String;
Signature 26: call(S)V
Signature 27: call(SS)V
Signature 28: call(SSS)V
Signature 29: call(SSSS)V
Signature 30: call(SSSSS)V
Signature 31: readByte(I)B
Signature 32: writeByte(IB)V
Signature 33: setBit(III)V
Signature 34: getDataAddress(Ljava/lang/Object;)I
Signature 35: resetSerial()V
Signature 36: readSensorValue(II)I
Signature 37: setSensorValue(III)V
Signature 38: setPoller()V
Signature 39: setThrottle(I)V
Signature 40: test(Ljava/lang/String;Z)V
Signature 41: testEQ(Ljava/lang/String;II)V
Signature 42: floatToIntBits(F)I
Signature 43: intBitsToFloat(I)F
Signature 44: init()V
Signature 45: write([BI)V
Signature 46: read()I
Signature 47: isSending()Z
Signature 48: isSendError()Z
Signature 49: getRegionAddress()I
Signature 50: toString()Ljava/lang/String;
Signature 51: <init>(Ljava/lang/String;)V
Signature 52: <init>([CII)V
Signature 53: arraycopy([CI[CII)V
Signature 54: getRuntime()Ljava/lang/Runtime;
Signature 55: setNumber(III)V
Signature 56: refresh()V
Signature 57: clear()V
Signature 58: print(Ljava/lang/String;)V
Signature 59: print([C)V
Signature 60: printChar(CI)V
Signature 61: native_print_pos_0(B)V
Signature 62: native_print_pos_1(B)V
Signature 63: native_print_pos_2(B)V
Signature 64: native_print_pos_3(B)V
Signature 65: native_print_pos_4(B)V
Signature 66: getCharacters(Ljava/lang/String;)[C
Master record : 16 bytes.
Class records : 27 (270 bytes).
Field records : 15 (15 bytes).
Method records: 63 (756 bytes).
Code          : 50 (1600 bytes).
downloading...
read binary
  100%
download binary
Loading native libs
Unable to load native libraries: no jirtrcx in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: josx.rcxcomm.Tower.close()I
   at josx.rcxcomm.Tower.close(Native Method)
   at josx.rcxcomm.Tower.closeTower(Tower.java:53)
   at js.tools.Download.close(Download.java:88)
   at js.tools.LejosdlTool.start(LejosdlTool.java:120)
   at js.tools.Lejosdl.start(Lejosdl.java:82)
   at js.tools.LejosLinkAndDownload.run(LejosLinkAndDownload.java:89)
   at js.tools.LejosLinkAndDownload.main(LejosLinkAndDownload.java:43)
done. If no error occurred, please press the RUN Button on your RCX now. The LCD of the RCX should display SMOKE, then TEST
bits@bits-laptop:~/lejos/check$


So, how do I get this lib into the java.library.path?
I tried a possible solution I found on the forums which said to compile the code under the /home/bits/lejos/src/comms/libjirtrcx, but when I do that I get an error that says that jni.h cannot be found.
Code: Select all
bits@bits-laptop:~/lejos/src/comms/libjirtrcx$ make
gcc -Wall -rdynamic -ldl -shared -fpic -I""/include -I""/include/ -I"/home/bits/lejos/src/comms/libirtrcx" -L -lirtrcx  -o "/libjirtrcx.so" *.c
tower.c:1:17: error: jni.h: No such file or directory
In file included from tower.c:9:
josx_rcxcomm_Tower.h:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
josx_rcxcomm_Tower.h:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
josx_rcxcomm_Tower.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
josx_rcxcomm_Tower.h:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
josx_rcxcomm_Tower.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
josx_rcxcomm_Tower.h:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
josx_rcxcomm_Tower.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
josx_rcxcomm_Tower.h:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
josx_rcxcomm_Tower.h:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
tower.c:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_fieldIDPort’
tower.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_fieldIDError’
tower.c:32: error: expected ‘)’ before ‘*’ token
tower.c:33: error: expected ‘)’ before ‘*’ token
tower.c:34: error: expected ‘)’ before ‘*’ token
tower.c:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
tower.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
tower.c:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
tower.c:132: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
tower.c:157: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
tower.c:185: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
tower.c:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
tower.c:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
tower.c:254: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
tower.c:272: error: expected ‘)’ before ‘*’ token
tower.c:280: error: expected ‘)’ before ‘*’ token
tower.c:288: error: expected ‘)’ before ‘*’ token
make: *** [/libjirtrcx.so] Error 1

I've never coded in C, so I don't know how to solve that one.

Thanks for any help!
Vance[/code]

I solved this problem. Solving it was rather tricky, so I may post a little tutorial on how to do it.
look up and see the chemtrails
www.carnicom.com
User avatar
JavaMan
Novice
 
Posts: 27
Joined: Tue Apr 01, 2008 1:47 pm
Location: United States

provide the solution

Postby ravi.xolve » Mon Jan 25, 2010 5:58 pm

Can you please provide us with the solution?
ravi.xolve
New User
 
Posts: 1
Joined: Mon Jan 25, 2010 5:50 pm

Postby exuvo » Wed Feb 10, 2010 9:47 pm

The fix for "jni.h not found" is to set your JAVA_HOME to point to where your java is installed.
In linux add (for me) "export JAVA_HOME=/usr/lib/j2sdk1.6-sun" to your .bashrc
In windows im not sure but google "setting JAVA_HOME" or something.

I still get the "no jirtrcx in java.library.path".
exuvo
New User
 
Posts: 4
Joined: Wed Feb 10, 2010 9:39 pm


Return to RCX Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff