(answers below each question)

> 
> --Simple question first: "Is it possible to use the JNI with AIX JDK 1.1.6
> and egcs/gcc C/C++  compiler under the AIX OS 4.x ??? "
> 

Assuming IBM didn't mistakenly leave JNI out of their port, then yes.

> --Harder question: "If the answer to the first question is 'yes' then HOW
> could it be done ? "
>

Same as for any other platform: write a Java class that uses native
methods, compile the class, run 'javah -jni classname' to generate the
header, write the native implementation, 'gcc -shared foo.c -o
libfoo.so'

See The Java Tutorial for more detail:

 http://java.sun.com/docs/books/tutorial/native1.1/index.html

> IBM only describes the use of the JNI with its own IBM C-Set C/C++
> compiler and that isn't very useful for egcs. (They changed the way to use
> JNI compared to the way you can use it under Linux/JDK and Sun/JDK in a
> lot of points).
> 

... just as Sun only describes using the SPARC native compilers. In the
Java Tutorial JNI lessons, whenever you see '-G', replace it with
'-shared' for gcc/egcs. All other compiler options are as you would
normally use them ('-g' for debug, '-O' for optimization, etc.).

I also recommend reading the 'jdk1.2/include/jni.h' and
'jdk1.2/include/<os>/jni_md.h' files (where <os> is your OS). The Java
Developers' Almanac has a nice section with an overview of the JNI types
and methods, as well - great for reference.



-- 
Jeff Galyan
http://www.anamorphic.com
http://www.sun.com
jeffrey dot galyan at sun dot com
talisman at anamorphic dot com
Sun Certified Java(TM) Programmer
======================================================================
Linus Torvalds on Microsoft and software development:
"... if it's a hobby for me and a job for you, why are you doing such a
shoddy job of it?"

The views expressed herein do not necessarily reflect those of my
employer.

Sun Microsystems, Inc., has no connection to my involvement with the
Mozilla Organization.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
  • JNI Steffen Tacke
    • JNI Jeff Galyan
    • JNI Paul Beardsley
      • JNI Paul Beardsley

Reply via email to