Changeset 4838


Ignore:
Timestamp:
02/24/09 12:12:01 (11 years ago)
Author:
melissa
Message:

Fixed segmentation fault and added check to see if JVM was successfully created.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/native/bf-cpp/source/showinfJNI.cpp

    r4837 r4838  
    6565  options[0].optionString = (char*) classpath.c_str(); 
    6666  //options[1].optionString = "-verbose:jni"; 
    67   vm_args.version = 0x00010004; // VM version 1.4 
     67  vm_args.version = JNI_VERSION_1_4; // VM version 1.4 
    6868  vm_args.options = options; 
    69   vm_args.nOptions = 2; 
     69  vm_args.nOptions = 1; 
    7070 
    7171  // load and initialize a Java VM, return a JNI interface pointer in env 
    72   JNI_CreateJavaVM(&jvm, (void**) &env, &vm_args); 
     72  if (JNI_CreateJavaVM(&jvm, (void**) &env, &vm_args)) { 
     73    cout << "Failed to create the JVM" << endl; 
     74    exit(1); 
     75  } 
    7376 
    7477  // invoke the ImageInfo.main(String[]) method using the JNI 
Note: See TracChangeset for help on using the changeset viewer.