I'm an m2 newbie trying to implement our JNI library building via the
native-maven-plugin. I've grabbed the latest source and built it and
installed it.
How are these projects normally set up? I'm trying to get the Sun JNI
Tutorial example working before I tackle our actual project. I initially
setup a POM with 2 modules, test-jni-java and test-jni-native, but I end up
with circular dependencies, since the java code needs to be compiled before
javah can be run and the native lib compiled, but then the java code has a
dependency on the compiled native lib.
Any suggestions on how to setup this project? Any example projects out there
I can look at?
Additionally, the native:javah goal is not running correctly. It doesn't
seem to be generating a classpath entry. I get this:
[INFO] C:\j2sdk1.4.2_09\jre\..\bin\javah.exe -d
C:\src\WORKSP~4\test-jni\test-jn
i-native\src\main\native -classpath HelloWorld
Error: Class HelloWorld could not be found.
I don't see from the documentation where I specify the classpath. I cheated
and added an additional className entry:
<classNames>
<className>test-jni-java/target/classes</className>
<className>HelloWorld</className>
</classNames>
which generates the correct command line for javah, but is clearly the wrong
way to do it.
Finally, while I'm compiling on Windows for now (MinGW gcc), I'll need to
compile on Linux and Solaris eventually. I don't see how one sets this up to
run on the appropriate platform, since win32 is specified in the POM itself.
thanks,
Logan Allred