// File: invoke.c // Compile with: // gcc -g -m64 -o inv inv.c -L/lib/amd64/gcj-4.6.2-12 -ljvm \ // -R/lib/amd64/gcj-4.6.2-12 \ // -R/lib/gcc/i386-pc-solaris2.11/4.6.2/amd64 // The -g -m64 is optional, of course. The last -R should not be // neccesary but is on my install. #include int main( int argc, char *argv[] ) { JNIEnv *env; JavaVM *jvm; jint res; JavaVMInitArgs vm_args; JavaVMOption options[1]; options[0].optionString = "-Djava.class.path=."; vm_args.version = 0x00010002; vm_args.options = options; vm_args.nOptions = 1; vm_args.ignoreUnrecognized = JNI_TRUE; // This segfaults in the Boehm GC, in // boehm-gc/os_dep.c:810 res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); return 0; } /* End of file: invoke.c */