1

I have an ultra simple file in an empty directory:

public class Test {
    public static void main(String[] args) {
        System.out.println("Test");
    }
}

And the following works as expected

javac Test.java
java Test
> Test

I am on Mac OS X, using emma-2.0.5312 and java 1.7.0_40

emma.jar has been installed to /Library/Java/Extensions, so this works

java emmarun

(it displays the help for using emmarun)

Next I run

java emmarun -cp . Test

And I get the error:

emmarun: [MAIN_METHOD_NOT_FOUND] application class [Test] does not have a runnable public main() method
Exception in thread "main" com.vladium.emma.EMMARuntimeException: [MAIN_METHOD_NOT_FOUND] application class [Test] 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

What causes this? Clearly it does have a public, accessible main method, so why can't emma find it?

Henry
  • 6,502
  • 2
  • 24
  • 30

1 Answers1

1

As per this link http://vikashazrati.wordpress.com/2011/10/09/quicktip-verifyerror-with-jdk-7/

If I use

java -XX:-UseSplitVerifier emmarun -cp . Test

It works just fine

Apparently there are some changes to the bytecode in this version of java, and emma has not been updated to deal with it.

Henry
  • 6,502
  • 2
  • 24
  • 30
  • Hi Henry, I tried to use this but it didn't work. Please take a look. I used following link for reference - http://users.csc.calpoly.edu/~jdalbey/309/Lectures/emmademo.html \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] emmarun: [MAIN_METHOD_NOT_FOUND] application class [CircleConverter] does not have a runnable public main() method – For Testing Feb 10 '17 at 23:44