Linux:编译so文件
gcc TestNative.cpp -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux" -fPIC -shared -o testnative.so
参考:https://stackoverflow.com/questions/13466777/jni-h-no-such-file-or-directory
http://blog.csdn.net/rocgege/article/details/58585225
Linux:so文件与Java文件在同一个目录下运行Java程序
java -Djava.library.path=. Hello
参考:https://stackoverflow.com/questions/3950635/how-to-compile-dynamic-library-for-a-jni-application-on-linux
使用gcc -m32编译32位so包时报错
fatal error sys/cdefs.h no such file or directory m32
sudo apt-get install libx32gcc-4.8-dev
sudo apt-get install libc6-dev-i386
参考:https://stackoverflow.com/questions/23498237/compile-program-for-32bit-on-64bit-linux-os-causes-fatal-error