>From JDK documentation 
>(https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html): 

"When you use the -jar option, the specified JAR file is the source of all user 
classes, and other class path settings are ignored."

So if you really want to use offline instrumentation (why?) you need to 
instrument the jar file.

As always we recommend using the JaCoCo agent as a Java agent without the 
hassles of offline instrumentation.

Regards,
-marc


> On 21. Nov 2018, at 17:55, [email protected] wrote:
> 
> Hello Jacoco Team,
> 
> I was trying out several configurations for code coverage using Jacoco. I ran 
> into one query. Please help to resolve it.
> 
> I have a Java Application which is executed using "java -jar service-app.jar" 
> command. I tried to use offline instrumentation on this. I took the class 
> file and used below command to do offline instrumentation
> "java -jar jacococli.jar instrument service/target/classes --dest 
> /instrumented"
> 
> Then I am starting the application using below command :
> java -Djacoco-agent.output=tcpserver -Djacoco-agent.address=localhost 
> -Djacoco-agent.port=6300 -Djacoco-agent.append=false -Djacoco-agent.jmx=true 
> -cp .:instrumented:jacocoagent.jar -jar service-app.jar
> 
> but when I am trying to dump the coverage it show error :
> 
> [INFO] Connecting to localhost/127.0.0.1:6300.  
> 
> This does not happen with java application that I start using Class Name(java 
> Hellomain) instead of "java -jar" command.
> 
> Can you help regarding this.
> Is there any configuration I am missing ?
> 
> Thanks
> Amit
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/83bff381-865e-48f9-b478-9fa7c80c50a0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/6174F0C1-61F5-47E5-AD85-5C9211ED92C4%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to