Problems Completing the ANT build

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

Moderator: roger

Problems Completing the ANT build

Postby rphilp » Mon Nov 15, 2010 3:07 am

Hi:
Hopefully this is a simple noob problem. I'm following the instructions for the first steps (http://lejos.sourceforge.net/rcx/tutori ... linux.html) and I can't seem to complete the ANT build of the code. I believe I've set the environment variables properly, but ANT returns the following error messages:
--------------------------
Buildfile: build.xml

clean:
[echo] saving existing files to .bak files
[move] Moving 2 files to /home/robert/lejos/bin

emulator:

clean:

make:
[cc] 2 total files to be compiled.
[cc] Starting link

irctrcx.libs:
[exec] gcc -o /home/robert/lejos/build/../bin/libirtrcx.so /home/robert/lejos/src/comms/libirtrcx/rcx_comm.o /home/robert/lejos/src/comms/libirtrcx/rcx_comm_linux.o -shared

jirctrcx.libs:
[exec] gcc -Wall -rdynamic -ldl -shared -fpic -I""/include -I""/include/linux -I"/home/robert/lejos/build/../src/comms/libirtrcx" -L/home/robert/lejos/build/../bin -lirtrcx -o "/home/robert/lejos/build/../bin/libjirtrcx.so" *.c
[exec] tower.c:1:17: error: jni.h: No such file or directory
[exec] In file included from tower.c:9:
[exec] josx_rcxcomm_Tower.h:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] josx_rcxcomm_Tower.h:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
[exec] josx_rcxcomm_Tower.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
[exec] josx_rcxcomm_Tower.h:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] josx_rcxcomm_Tower.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] josx_rcxcomm_Tower.h:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] josx_rcxcomm_Tower.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] josx_rcxcomm_Tower.h:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] josx_rcxcomm_Tower.h:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] tower.c:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_fieldIDPort’
[exec] tower.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_fieldIDError’
[exec] tower.c:32: error: expected ‘)’ before ‘*’ token
[exec] tower.c:33: error: expected ‘)’ before ‘*’ token
[exec] tower.c:34: error: expected ‘)’ before ‘*’ token
[exec] tower.c:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] tower.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] tower.c:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] tower.c:132: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] tower.c:157: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] tower.c:185: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] tower.c:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jint’
[exec] tower.c:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
[exec] tower.c:254: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘jboolean’
[exec] tower.c:272: error: expected ‘)’ before ‘*’ token
[exec] tower.c:280: error: expected ‘)’ before ‘*’ token
[exec] tower.c:288: error: expected ‘)’ before ‘*’ token
[exec] make: *** [/home/robert/lejos/build/../bin/libjirtrcx.so] Error 1

BUILD FAILED
/home/robert/lejos/build/build.xml:76: exec returned: 2
-------------------------
The first error appears to be that the compiler can't find jni.h. I located this file in the usr/lib/jvm/java-1.6.0-openjdk/include directory, so I added it to the PATH, and the CLASSPATH environment variables. Still no joy.
What stupid noob thing have I probably done, or failed to do?

Thanx,
Rob P.
rphilp
New User
 
Posts: 1
Joined: Mon Nov 15, 2010 2:58 am

Postby davidek » Sun Dec 19, 2010 10:09 pm

Hi!

I faced the same problem.

Call
    export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk/
right before running ant and it should work.

Why isn't this mentioned in the documentation (README.html or in the leJOS Tutorial)?

Regards,
davidek
davidek
New User
 
Posts: 2
Joined: Sun Dec 19, 2010 9:40 pm

Postby davidek » Sun Dec 19, 2010 10:44 pm

davidek wrote:Why isn't this mentioned in the documentation (README.html or in the leJOS Tutorial)?


Whoops,
    # Make sure you have set JAVA_HOME properly to the root directory of the JDK
in lejos.3.0.0-RC2/README.html > Preliminaries.
davidek
New User
 
Posts: 2
Joined: Sun Dec 19, 2010 9:40 pm


Return to RCX Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff