JVM does not come up...

I've a java program when invoked normally (javac myClass), gives the following error:

Exception occurred in main() of java.awt.Frame

java.lang.ClassFormatError: AppLayer/CGroup (Code of a method longer than 65535 bytes)

Well, I can understand this error. Still, without changing anything, if I invoke the same program with 'noverify' option, it works. (javac -noverify myClass).

Now I'm invoking the same class from VC++ code as follows. It does not load the class because of the method size limitation:

options[0].optionString = "-Djava.compiler=NONE";// disable JIT

options[1].optionString = classPath;

options[2].optionString = "-verbose:jni";

vm_args.version = JNI_VERSION_1_2;

vm_args.options = options;

vm_args.nOptions = 3; // Added noverify

vm_args.ignoreUnrecognized = JNI_FALSE; //JNI_TRUE;

jint res;

res = JNI_CreateJavaVM(&jvm,(void **) &env, &vm_args);

Here, how do I give the option corresponding to -noverify that I gave in command line? I guess if I could do this, then the class loading will go smooth from native code also.

[1178 byte] By [zhivagoa] at [2007-9-26 5:00:40]
# 1

Normally that errors requires the following to be true:

-A class as a very large method.

-The class was compiled under a version of java before 1.2.

-The class is being run in java 1.2 or greater.

If this is not the case for you then you probably have some sort of memory problem.

If it is the case then your solutions:

-Edit the class to make the method smaller.

-Use a java version before 1.2.

jschell at 2007-6-29 18:56:58 > top of Java-index,Java HotSpot Virtual Machine,Specifications...