views:

26

answers:

2

Is there a simple and portable way to build JNI - in particular the C components - with an automated build system such as ant or make (or both, with one calling the other) without having to manually input things like the extension of the final library file or the path to the Java includes folder to the C compiler?

A: 

See the accepted answer at: http://stackoverflow.com/questions/15305/jni-and-java-ant-calling-make-or-make-calling-ant

That's a nice way of running a C compiler from Ant, but it doesn't solve my problem - I'd still need to know where the libraries were and so on to pass it to the cc task.
Scott
A: 

This is really the case for a build environment variable. You can default it to $(JAVA_HOME)/include and $(JAVA_HOME)/lib; I think this is I did back when I used JNI.

Justin