Jacoco javaagent from command line

545 views
Skip to first unread message

chahid...@gmail.com

unread,
Sep 24, 2014, 11:27:18 AM9/24/14
to jac...@googlegroups.com
Hello,

Please i' trying to use jacoco javaagent arg from command line.
For exemple, i'm compiling my class with "javac MyClass" then i do "java -javaagent:/path/to/jacoco/jar MyClass"
the jacoco.exec is generated, but i get 0 coverage.
But if i add it as an VM Arg on eclipse and run the application from Eclipse, the coverage appear fine.

Thank you in advance for your help.

Regards,
Issam

Marc R. Hoffmann

unread,
Sep 24, 2014, 4:05:33 PM9/24/14
to jac...@googlegroups.com
How do you create the report?

Regards,
-marc

Issam CHAHID

unread,
Sep 24, 2014, 4:22:33 PM9/24/14
to jac...@googlegroups.com
Marc,

I'm just taking the jacoco.exec and import it in Eclipse with the "EclEmma Jacoco Code Coverage plugin".
Or with SonarQube...

Regards,
Issam

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/kGp9tGqGzHE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc R. Hoffmann

unread,
Sep 24, 2014, 11:47:29 PM9/24/14
to jac...@googlegroups.com
This won't work. See documentation:

Warning: Imported execution data must be based on the exact same class files that are also used within the Eclipse IDE. If the external launch was based on different class files (e.g. created with different compiler) no coverage will be shown.

http://www.eclemma.org/userdoc/importexport.html

-marc


On 24.09.14 22:22, Issam CHAHID wrote:

Issam CHAHID

unread,
Sep 28, 2014, 9:59:35 AM9/28/14
to jac...@googlegroups.com
Thank you Marc for these explanations

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/kGp9tGqGzHE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages