jni - How to compile JNI_CreateJavaVM -


i have following code. command in linux compile piece of code. gcc thisfile.c says jni_version_1_6 undeclared..

#include <stdio.h> #include <jni.h> #include <string.h>  jnienv* create_vm(javavm ** jvm) {      jnienv *env;     javavminitargs vm_args;     javavmoption options;      vm_args.version = jni_version_1_6; //jdk version. indicates version 1.6     vm_args.noptions = 1;     vm_args.options = &options;     vm_args.ignoreunrecognized = 0;      int ret = jni_createjavavm(jvm, (void**)&env, &vm_args);     if(ret < 0)         printf("\nunable launch jvm\n");     return env; }   int main(int argc, char* argv[]) {     jnienv *env;     javavm * jvm;      return 1; } 

ok, got myself answered. hope someone

echo $java_home /usr/lib/jvm/java-1.6.0 gcc -o invoke -i$java_home/include/ -i$java_home/include/linux -l$java_home/jre/lib/amd64/server/ -ljvm call.c


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -