> 
>         jclass cls = env->FindClass("Main");
>         jmethodID mid = env->GetStaticMethodID(cls, "main", "()V");
> 

I'm no expert, but your problem appears to be right
above.  You are trying to locate a main method that
takes no args, but your main method in your java program
takes an array of strings as args.  Try removing the
String[] args from your java method.

In any case, you probably want to check that you
actually found the method you were looking for.
ie :

    if ( mid == 0 ) {
       fprintf(stderr, "unable to locate method");
       exit(1);
    }

ditto for FindClass.

One other thing.  In the demo code for the java
tutorial at javasoft, they have the following
two lines of code at the beginning:
  /* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond
*/
    vm_args.version = 0x00010001;

Since you are using 1.1.7, and they claim it's important,
you might want to add the above in before you do anything.


later

jp



> 
> public class Main
> {
>         public static void main(String[] args)
>         {
>                 System.out.println("Running Java ...");
>         }
> }
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to