简体   繁体   English

Emma 代码覆盖工具错误 - Main 方法未找到

[英]Emma code coverage tool error - Main method not found

I am using Emma code coverage tool and I have Java8.我正在使用 Emma 代码覆盖率工具,并且我有 Java8。 I am new to Emma and there is very less help available.我是 Emma 的新手,可用的帮助非常少。 I tried to use following links.我尝试使用以下链接。

  1. http://emma.sourceforge.net/intro.html http://emma.sourceforge.net/intro.html
  2. http://users.csc.calpoly.edu/~jdalbey/309/Lectures/emmademo.html 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:

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我通过以下链接找到了解决方案: 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.但简而言之,java7 引入了更严格的验证并禁用它,如果您使用的是 java7,我们可以添加选项“-XX:-UseSplitVerifier”,如果您使用的是 java8,我们可以添加选项“-noverify”。

So the correct command line for java8 would be :所以java8的正确命令行是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM