invoking Error: (possibly COFF)

Discussion in 'Java' started by Québec, Jul 27, 2004.

  1. Québec

    Québec Guest

    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;
    }
     
    Québec, Jul 27, 2004
    #1
    1. Advertising

  2. Québec

    Liz Guest

    "Québec" <> wrote in message
    news:V_iNc.3239$...
    > 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.
     
    Liz, Jul 27, 2004
    #2
    1. Advertising

  3. On Mon, 26 Jul 2004 22:20:49 -0400, Québec wrote:
    > 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

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Jul 27, 2004
    #3
  4. Québec

    Québec Guest

    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" <> a écrit dans le message de
    news:4105f64c$...
    > On Mon, 26 Jul 2004 22:20:49 -0400, Québec wrote:
    > > 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
    >
    > --
    > [ do not email me copies of your followups ]
    > g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Québec, Jul 27, 2004
    #4
  5. Québec

    zoopy Guest

    On 27-7-2004 13:13, Québec wrote:
    > 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" <> a écrit dans le message de
    > news:4105f64c$...
    >
    >>On Mon, 26 Jul 2004 22:20:49 -0400, Québec wrote:
    >>
    >>> 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
    >>
    >>--
    >>[ do not email me copies of your followups ]
    >>g o r d o n + n e w s @ b a l d e r 1 3 . s e

    >
    >
    >


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

    Regards,
    Z.
     
    zoopy, Jul 27, 2004
    #5
  6. Québec

    Québec Guest

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

    Jean
     
    Québec, Jul 27, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dan byers
    Replies:
    1
    Views:
    611
    Hans =?iso-8859-1?Q?J=F8rgen?= Jakobsen
    Mar 6, 2004
  2. Replies:
    2
    Views:
    274
  3. James T. Dennis
    Replies:
    9
    Views:
    324
    Dennis Lee Bieber
    May 11, 2007
  4. nirvana
    Replies:
    3
    Views:
    256
    Walter Roberson
    Apr 16, 2008
  5. devaraja007
    Replies:
    2
    Views:
    1,804
    devaraja007
    Apr 1, 2009
Loading...

Share This Page