Source build cannot find jni.h

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

Moderators: roger, 99jonathan, imaqine

Source build cannot find jni.h

Postby breneez » Mon May 21, 2007 2:10 pm

For kicks, I was attempting to build the NXJ project from source, per the instructions in the README. But it doesn't seem to be able to find my JNI headers (jni.h). Where is the appropriate place to specify my JDK install?
breneez
New User
 
Posts: 8
Joined: Wed May 16, 2007 4:39 am
Location: Raleigh, NC

Postby lawrie » Tue May 22, 2007 7:58 pm

Where is the build failing? I guess it is in libnxt as that is the only part that I think currently uses jni. As jlibnxt is not used for anything much yet, you can remove the build of that from SConstruct and the rest of the libnxt build should work. The build of jlibnxt worked for me, but that may be because I ran it from Eclipse. I will look at whsat I need o do ti the SConstruct file to make it work outside Eclipse.
lawrie
leJOS Team Member
 
Posts: 677
Joined: Mon Feb 05, 2007 1:27 pm

Postby breneez » Wed May 23, 2007 2:37 am

Thanks for your reply,

I'm not very familiar with the output of scons, though the build.xml looks pretty similar to ant. It doesn't look like it tells you which targets it's working on like ant.

The script prints:

Code: Select all
adam@Echelon:~/esvn_wksp/lejos/lejos/trunk/libnxt$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: `libnxt.a' is up to date.
scons: `fwflash' is up to date.
scons: `runc' is up to date.
scons: `runjava' is up to date.
scons: `nxjupload' is up to date.
scons: `nxjflash' is up to date.
gcc -o main_jlibnxt.os -c -Wall -std=gnu99 -g -ggdb -D_NXT_LITTLE_ENDIAN -fPIC main_jlibnxt.c
In file included from main_jlibnxt.c:29:
jlibnxt.h:2:17: error: jni.h: No such file or directory
In file included from main_jlibnxt.c:29:
jlibnxt.h:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'jint'
jlibnxt.h:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
jlibnxt.h:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
jlibnxt.h:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
jlibnxt.h:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'jbyteArray'
main_jlibnxt.c:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'jint'
main_jlibnxt.c:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
main_jlibnxt.c:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
main_jlibnxt.c:68: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
main_jlibnxt.c:84: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'jbyteArray'
scons: *** [main_jlibnxt.os] Error 1
scons: building terminated because of errors.


I tried throwing a pathelement to my JDK include directory in with all the includepath elements, but it didn't seem to do any good.
breneez
New User
 
Posts: 8
Joined: Wed May 16, 2007 4:39 am
Location: Raleigh, NC


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff