Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > AIX JNI Link with G++ module Problem

Thread Tools

AIX JNI Link with G++ module Problem

Posts: n/a
Hi, I changed C source to C++ source and compiled with g++.

The output file is .so module which java source calls JNI native
function in the


However, when aix server restart and try to call native funtion, there
is the error

like this : java.lang.UnsatisfiedLinkError. and... when I try
again, the error

changes to java.lang.NoClassDefFoundError.

My c++ source code are fully tested except for JNI related function

Is there something wrong with this jni part or :

jint iPathSize = env->GetArrayLength(savepath);
jint iNameSize = env->GetArrayLength(filename);
jint iSourceSize = env->GetArrayLength(source);
jbyte * aSavePath = env->GetByteArrayElements(savepath, 0);
jbyte * aFileName = env->GetByteArrayElements(filename, 0);
jbyte * aSource = env->GetByteArrayElements(source, 0);

// some stuffs

env->ReleaseByteArrayElements(savepath, aSavePath, 0);
env->ReleaseByteArrayElements(filename, aFileName, 0);
env->ReleaseByteArrayElements(source, aSource, 0);

is there something I should set in java for using c++ jni function?

please help me T.T any ideas?

enviroment: AIX 5.1 gcc 4.0

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
putenv for AIX and ifdef for AIX ClownPleco C Programming 5 08-24-2007 02:15 PM
AIX JNI Link with G++ module Problem chriskr7 C++ 1 07-13-2006 03:14 AM
JNI FindClass(java/lang/string) causes core dump on AIX 5.2 Java 2 03-31-2006 08:00 PM
Looking for AIX 5.2 binaries, IS anyone running Ruby on AIX 5.2 ?? Ruby 5 07-08-2005 11:54 AM
jvm core dump with jni c++ on AIX only Mike Java 0 12-09-2003 05:15 PM