dependency-check / azuredevops

Dependency Check Azure DevOps Extension
Apache License 2.0
47 stars 25 forks source link

Java Not Found #16

Closed ejohn20 closed 5 years ago

ejohn20 commented 5 years ago

Submitted from Marina Radcke:

Running the task using a Windows Server 2019 agent leads to the error:

'java' is not recognized as an internal or external command, operable program or batch file.

I get the same error when running the dependency-check.bat file (downloaded from OWASP) in a Command-Line task. Java is installed, running java -version in Command Prompt shows the version, and running dependency-check.bat directly on the server is working, too.

ejohn20 commented 5 years ago

Solved by adding environment variable JAVACMD to the server and setting it to C:\PROGRA~2\Java\jre1.8.0_211\bin.

It is important to use PROGRA~2, otherwise, the spaces in "Program Files (x86)" cause trouble.

ejohn20 commented 5 years ago

Is this issue occurring on a self hosted 2019 build server? Or an Azure-hosted build agent?

mradckeIRT commented 5 years ago

It's a self-hosted 2019 build server.

ejohn20 commented 5 years ago

Ok, perfect. thanks for letting us know about this scenario.

I'm going to close this issue.