For Testing
For Testing

Reputation: 421

Emma code coverage tool error - Main method not found

I am using Emma code coverage tool and I have Java8. I am new to Emma and there is very less help available. I tried to use following links.

  1. http://emma.sourceforge.net/intro.html
  2. http://users.csc.calpoly.edu/~jdalbey/309/Lectures/emmademo.html

But I keep getting following error when I try to run:

java -cp emma.jar emmarun -jar .../jdk1.4.2/demo/jfc/SwingSet2/SwingSet2.jar 
java -cp TestTools\emma.jar;. emmarun -cp . CircleConverter 

I also tried options from here but it didn't help.

Error is-

CoverageDemo>java -XX:-UseSplitVerifier -cp TestTools\emma.jar;. emmarun -cp . CircleConverter
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0
EMMA: no coverage data collected at runtime [all reports will be empty]
EMMA: writing [txt] report to [C:\Users\pkothavale\Downloads\CoverageDemo\coverage.txt] ...
[EMMA v2.0, build 4217]
emmarun: [MAIN_METHOD_NOT_FOUND] application class [CircleConverter] does not have a runnable public main() method
Exception in thread "main" com.vladium.emma.EMMARuntimeException: [MAIN_METHOD_NOT_FOUND] application class [CircleConverter] 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
Exception Details:

Upvotes: 1

Views: 406

Answers (1)

Ben7
Ben7

Reputation: 91

in fact, the problem is due to this line :

Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 11

I found the solution with this link : java.lang.VerifyError: Expecting a stackmap frame at branch target JDK 1.7

But in short, java7 introduced stricter verification and to disable it, we can add the option "-XX:-UseSplitVerifier" if you are using java7 or "-noverify" if you are in java8.

So the correct command line for java8 would be :

java -noverify -cp emma.jar emmarun -jar .../jdk1.4.2/demo/jfc/SwingSet2/SwingSet2.jar

Upvotes: 2

Related Questions