Dude, you want us to write the code for you as well??

Pierre Heroux <[EMAIL PROTECTED]> wrote:
> I have a "Segmentation fault (core dumped)" message when I execute the
> following source.
> 
> #include <jni.h>
> #include <iostream>
> 
> int main()
>   {
>   const int nOpts = 4;
>   JavaVMOption options[nOpts];
>   int ii=0;
>   options[ii++].optionString = "-Djava.compiler=NONE";
>   options[ii++].optionString = "-Djava.class.path=.";
>   options[ii++].optionString = "-Djava.library.path=.";
>   options[ii++].optionString = "-verbose:jni,class,gc";
> 
>   JavaVMInitArgs vm_args;
>   vm_args.version = JNI_VERSION_1_2;
>   vm_args.options = options;
>   vm_args.nOptions = nOpts;
>   vm_args.ignoreUnrecognized = JNI_TRUE;
> 
>   JavaVM *jvm;
>   JNIEnv *env;
>   jint res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args); /*debugger
> message : Program received signal SIGSEGV, Segmentation fault.
> 0x401d5ca8 in main_arena ()*/
>   if(res < 0)
>     {
>     cerr << "Can't create Java VM" << endl;
>     exit(1);
>     }
>   cout << "JNI_CreateJavaVM() is OK" << endl;
>   jvm->DestroyJavaVM();
>   }
> 
> g++ -g simple.cpp -L/usr/local/jdk/jre/lib/i386
> -L/usr/local/jdk/jre/lib/i386/classic
> -L/usr/local/jdk/jre/lib/i386/native_threads -ljava -ljvm -lpthread
> -lhpi -o Simple
> Simple
> 
> I use java version "1.2"
> Classic VM (build Linux_JDK_1.2_pre-release-v2, native threads, nojit)
> on RedHat5.2
> 
> 
> Thanks a lot,
> Pierre
> 
> 
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]


____________________________________________________________________
Get free email and a permanent address at http://www.amexmail.com/?A=1


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to