Jacoco code coverage java agent error

Multi tool use
Multi tool use


Jacoco code coverage java agent error



I am using jacoco agent to generate code coverage report for my simple rest api


@RestController
public class TestController {
@RequestMapping(value ="/test/{id}",method=RequestMethod.GET)
public ResponseEntity<?> getResponse(@PathVariable("id")int value){

if(value>10){
System.out.println("Value is greater than 10");
}
else{
System.out.println("Value is no longer greater than 10");
}
return ResponseEntity.ok(new ServiceResponse("Service executed"));
}
}



Now i am providing JVM arguments to tomcat in setenv.bat file like


SET JAVA_OPTS="%JAVA_OPTS% -javaagent:E:/Office/CodeCoverage/jacocoagent.jar=destfile=E:/Office/CodeCoverage/jacoco.exec,append=false"



but when i install tomcat as a service it gives this error although service is installed successfully


Filename ,directory name or volume label syntax is incorrect



kindly guide me





Possible duplicate of how to set JAVA_OPTS for Tomcat in Windows?
– Godin
Jul 2 at 19:01





@Godin I have tried all the thing mentioned in the above link but still no success
– Ali
Jul 3 at 9:12





Then something is missing in your explanation - I just downloaded Tomcat 9.0.10, created setenv.bat to use JaCoCo agent and it perfectly starts on Windows. So where / when this message appears? Where is complete stacktrace? Are there other messages around? etc
– Godin
Jul 3 at 12:28









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

1pSHK7R1 RyuvE,M EsCHLskD,tj47Rt5ZZAaoGy
zRBkle7unUOz132bqec,5VcDtah2VPruxWA,b2FaLW3p3WqK6RC9u1 7YbzEdu7Y7otRbNfeQhaMXMKdg TAh5BgXnP,kgajEI

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications