0

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

Godin
  • 9,801
  • 2
  • 39
  • 76
Ali
  • 557
  • 1
  • 9
  • 30
  • Possible duplicate of [how to set JAVA\_OPTS for Tomcat in Windows?](https://stackoverflow.com/questions/14731174/how-to-set-java-opts-for-tomcat-in-windows) – Godin Jul 02 '18 at 19:01
  • @Godin I have tried all the thing mentioned in the above link but still no success – Ali Jul 03 '18 at 09: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 03 '18 at 12:28

0 Answers0