0
votes

i am getting this fatal error

jni. h:No such file or directory
compilation terminated.

my typed command is

root@kali:/home/work#g++ -l/usr/lib/jvm/java-6-openjdk-i386/include -l/usr/lib/jvm/java-6-openjdk-i386/include/linux -o libhello.so Hello.c
1
The -l option (as in lower-case l) and the -I (as in upper-case i) options do different things. The -l (lower-case l) adds a library search path for the linker, the -I (upper-case `i') adds a search path for the preprocessor to look for header files.Some programmer dude
And for gods sake, please don't compile as root.bash0r
@bash0r, Just curious, Why not compile as root ?Saurabh Meshram
@SaurabhMeshram Can you control that the compiler output will not overwrite some really important system files? You can't, the root can do anything. In worst case your system won't boot or - even worse - will destroy some really important data because the compiler output has overwritten some files. Having a seperate user to compile source code with and going into root shell for make install after compilation brings a good barrier of protection to your system.bash0r

1 Answers

1
votes

It should be -I/usr/lib/jvm/java-6-openjdk-i386/include/linux