[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Example on JNI compilation

From: John Calcote
Subject: Re: Example on JNI compilation
Date: Mon, 20 Apr 2009 13:07:24 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2

On 4/18/2009 3:08 PM, LCID Fire wrote:
I'm currently stuck with compiling a JNI library, which java does not recognize. I'm not too sure about what options I have to provide to automake and which are already builtin. Does anybody know an example of how a jni lib is built using automake?
There are basically two steps to building JNI libraries:

1. Use the javah utility to generate JNI prototypes in C-language header files from your Java source code. 2. Compile the C-language JNI sources (including the headers generated in step 1) into a library.

Step 1 above is pure Java-speak, and Automake has little built-in functionality for it. Step 2, however is pure gcc, and Automake has no trouble with it. For an example of how to integrate javah operations into so you can do it all from Automake, see Chapter 6 of this online book at

Search for the text, "Building the JNI C++ sources".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]