Q
Québec
Hi to everyone,
Yes. A little tryal to this.
bcc32 InvocationTest.c C:\jdk1.1.8\lib\javai.lib
bcc32 InvocationTest.c -link C:\jdk1.1.8\lib\javai.lib
both gives:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
InvocationTest.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: 'C:\JDK1.1.8\LIB\JAVAI.LIB' contains invalid OMF record, type 0x21
(possibly COFF)
========
#include <jni.h>
#include <stdlib.h>
memset(JavaVMInitArgs *, JavaVMInitArgs *, unsigned int);
int main()
{
JavaVMOption options[3];
JavaVMInitArgs vm_args;
JavaVM *jvm;
JNIEnv *env;
long status;
jclass class_Welcome;
jclass class_String;
jobjectArray args;
jmethodID id_main;
options[0].optionString = "-Djava.class.path=.";
options[1].optionString = "-verbose:jni";
options[2].optionString = "-Djava.library.path=c:\\jdk1.1.8\\lib"; //
memset(&vm_args, 0, sizeof(vm_args));
vm_args.version = 0x00010001;
vm_args.nOptions = 2;
vm_args.options = options;
status = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (status == JNI_ERR)
{
printf("Error creating VM\n");
return 1;
}
class_Welcome = (*env)->FindClass(env, "Welcome");
id_main = (*env)->GetStaticMethodID(env, class_Welcome,
"main", "([Ljava/lang/StringV");
class_String = (*env)->FindClass(env, "java/lang/String");
args = (*env)->NewObjectArray(env, 0, class_String, NULL);
(*env)->CallStaticVoidMethod(env, class_Welcome,
id_main, args);
(*jvm)->DestroyJavaVM(jvm);
return 0;
}
Yes. A little tryal to this.
bcc32 InvocationTest.c C:\jdk1.1.8\lib\javai.lib
bcc32 InvocationTest.c -link C:\jdk1.1.8\lib\javai.lib
both gives:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
InvocationTest.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: 'C:\JDK1.1.8\LIB\JAVAI.LIB' contains invalid OMF record, type 0x21
(possibly COFF)
========
#include <jni.h>
#include <stdlib.h>
memset(JavaVMInitArgs *, JavaVMInitArgs *, unsigned int);
int main()
{
JavaVMOption options[3];
JavaVMInitArgs vm_args;
JavaVM *jvm;
JNIEnv *env;
long status;
jclass class_Welcome;
jclass class_String;
jobjectArray args;
jmethodID id_main;
options[0].optionString = "-Djava.class.path=.";
options[1].optionString = "-verbose:jni";
options[2].optionString = "-Djava.library.path=c:\\jdk1.1.8\\lib"; //
memset(&vm_args, 0, sizeof(vm_args));
vm_args.version = 0x00010001;
vm_args.nOptions = 2;
vm_args.options = options;
status = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (status == JNI_ERR)
{
printf("Error creating VM\n");
return 1;
}
class_Welcome = (*env)->FindClass(env, "Welcome");
id_main = (*env)->GetStaticMethodID(env, class_Welcome,
"main", "([Ljava/lang/StringV");
class_String = (*env)->FindClass(env, "java/lang/String");
args = (*env)->NewObjectArray(env, 0, class_String, NULL);
(*env)->CallStaticVoidMethod(env, class_Welcome,
id_main, args);
(*jvm)->DestroyJavaVM(jvm);
return 0;
}