invoking Error: (possibly COFF)

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/String;)V");

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;
}
 
L

Liz

Québec said:
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)

I don't use 'c' or 'c++' very much these days, but I cut and pasted
your program into a file and ran MS visual c++ version 6.0 and it
compiled with no errors. I did have a trivial problem with the include
files, but that is because I don't have my path set up (like I said
its been awhile.) Anyway, the problem is not in your program. It compiles
ok.
 
G

Gordon Beaton

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;

Ok I know this isn't related to your question, but you've provided 3
options and told the JVM there are only two. Was that intentional?

/gordon
 
Q

Québec

I changed it to
JavaVMOption options[3];
....
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 = 3;
vm_args.options = options;
.......................

and I have the same problem. It is a Borland problem?

Jean


Gordon Beaton said:
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;

Ok I know this isn't related to your question, but you've provided 3
options and told the JVM there are only two. Was that intentional?

/gordon
 
Z

zoopy

I changed it to
JavaVMOption options[3];
....
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 = 3;
vm_args.options = options;
.......................

and I have the same problem. It is a Borland problem?

Jean


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;

Ok I know this isn't related to your question, but you've provided 3
options and told the JVM there are only two. Was that intentional?

/gordon

STFW
<http://www.google.com/search?hl=en&lr=&ie=UTF-8&c2coff=1&q="possibly+COFF"+bcc32&btnG=Search>.
See for example <http://forum.java.sun.com/thread.jsp?thread=223041&forum=52&message=786080>

Regards,
Z.
 
Q

Québec

AT LAST!
it worked out the middle of this snakes pit.
May all and everything goodness fall on you.

Jean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top