|
|
|||||||
|
Great deal, my question is if someone has tried this on a Macosx system. I wasn't able to get the shared lib loaded using -dylib (the -shared of linux doesn't work any more). |
||||||||
|
|
|||||||
|
here how I compiled it under MacOSX 10.3.9: 1) create the java class javac -classpath . com/softtechdesign/math/MathLib.java 2) create the c header javah -jni -o MathLib.h -classpath . com.softtechdesign.math.MathLib 3) compile the c library note that jni libraries have to be named lib<yourLibHere>.jnilib cc -dynamiclib -std=gnu99 -I /Library/Java/home/include Math.c -current_version 1.0 -compatibility_version 1.0 -o libMathLib.jnilib 4) e voila now you can run the program java -classpath . com.softtechdesign.math.MathLib this worked for me. |