Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run EMMA code coverage

I have Java SE Development Kit 7u3 installed

I've been through some of the topics similar to this (e.x. "java" succeeds," java emmarun" fails) but my problem is that EMMA doesn't work for me at all. After I run:

java -cp emma.jar emmarun -cp . Main

it always says:

[EMMA v2.0, build 5312]
emmarun: [MAIN_METHOD_NOT_FOUND] application class [Main] does not have a runnable public main() method
Exception in thread "main" com.vladium.emma.EMMARuntimeException: [MAIN_METHOD_NOT_FOUND] application class [Main] does not have a runnable public main() method
        at com.vladium.emma.rt.AppRunner._run(AppRunner.java:497)
        at com.vladium.emma.rt.AppRunner.run(AppRunner.java:97)
        at com.vladium.emma.runCommand.run(runCommand.java:247)
        at emmarun.main(emmarun.java:27)
Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 11 in method Main.<init>()V at offset 4
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at com.vladium.emma.rt.AppRunner._run(AppRunner.java:493)

Compilation runs well ("javac Main.java") and application is working (I get the expected output from "java Main"). The code of Main.java is simple HelloWorld application.

public class Main{

public static void main(String[] args) {
    System.out.println("Hello, World");
}

I just wanted to run emmarun on any example code to see if it's working. Well, it is not. Any ideas on what I'm doing wrong?

like image 632
user1356305 Avatar asked Jun 27 '26 08:06

user1356305


1 Answers

This seems to be popping up in a few places. The solutions I have discovered so far are these:

  • Since you are using Java 7, it might be an issue with your emma plugin (if using eclipse). Apparently installing the beta for this plugin allows use of Java 7: Link: Testng, Emma, Cobertura, coverage and JDK 7 result in ClassFormatError and VerifyError

  • Comments from the same link talk about using the Java JVM option '-X:+UseSplitVerifier' to solve it too.

like image 118
cshortt Avatar answered Jun 29 '26 22:06

cshortt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!