-
Modify the code.
-
Tell Git to start tracking new/modified source code.
$ git add .
-
Commit code. Add useful comments.
$ git commit -m "Updated test.c to include tests on JPEG image."
-
Push the code to Github.
$ git push
$ cd unifying-sensor-api
$ make clean
$ make
$ test/testprogram <PATH_TO_JPEG>
$ make clean
Compile the C files (change the path to jni.h accordingly)
$ gcc -c -I/usr/lib/jvm/java-1.7.0-openjdk-i386/include -I/usr/lib/jvm/java-1.7.0-openjdk-i386/include/linux -I../lib unifying_functions.c UnifyingAPI.c ../lib/cJSON.c
Using the object files, build a shared library named "libCJavaInterface.so"
$ ld -G UnifyingAPI.o unifying_functions.o cJSON.o -o libCJavaInterface.so -lm -lc -lpthread
Compile the java program
$ javac HelloWorld.java
Run the Java program, make sure to include path to the shared lib
$ java -Djava.library.path=./ HelloWorld