Hi i am trying to use JVM in C, to run JBoss AS, i have already run it but now i need to stop it, JBoss has two bat files to do it, one for run and the other for stop, i am trying to use two diferent JVM but in the second it doesnīt recognize the JVM some help here itīs my code
Code:
JNIEnv* create_vmStart(char *path[]) {
JNIEnv* env;
JavaVM* jvm;
JavaVMInitArgs args;
JavaVMOption options[7];
/* There is a new JNI_VERSION_1_4, but it doesn't add anything for the purposes of our example. */
args.version = JNI_VERSION_1_4;
args.nOptions = 4;
options[6].optionString = "-Dsun.rmi.dgc.server.gcInterval=3600000";
options[5].optionString = "-Dsun.rmi.dgc.client.gcInterval=3600000";
options[4].optionString = "-server";
options[3].optionString = "-Xmx512m";
options[2].optionString = "-Xms128m";
options[1].optionString = "-Djava.endorsed.dirs=C:\\jboss-4.0.4.GA\\lib\\endorsed\\resolver.jar;"
"C:\\jboss-4.0.4.GA\\lib\\endorsed\\xalan.jar;"
"C:\\jboss-4.0.4.GA\\lib\\endorsed\\xml-apis.jar;"
"C:\\jboss-4.0.4.GA\\lib\\endorsed\\serializer.jar";
options[0].optionString = path;
args.options = options;
args.ignoreUnrecognized = JNI_FALSE;
JNI_CreateJavaVM(&jvm, (void **)&env, &args);
return env;
}
and the second virtual machine its something like
Code:
JNIEnv* create_vmStop(char *path[]) {
JNIEnv* env;
JavaVM* jvm;
JavaVMInitArgs args;
JavaVMOption options[1];
/* There is a new JNI_VERSION_1_4, but it doesn't add anything for the purposes of our example. */
args.version = JNI_VERSION_1_4;
args.nOptions = 1;
options[0].optionString = path;
args.options = options;
args.ignoreUnrecognized = JNI_FALSE;
JNI_CreateJavaVM(&jvm, (void **)&env, &args);
return env;
}
the porpuse to do this its to set to diferent kind of options one for start and other for stop, because they need different JAR files
when i call the second function env its 0xccccccc and jvm too some help???