azure-pipelines-agent: JavaSDK is wrong on capabilities

Agent version and platform

Version of your agent? Hosted Current agent version: ‘2.112.0’
OS of the machine running the agent? Windows

VSTS type and version

VisualStudio.com http://universalplatform.visualstudio.com

What’s not working?

I need to specify the JDK directory for my build, i look at the JDK on capabilities and it shows C:\Program Files\Java\jdk1.8.0_40 But that’s not the actually path for the jdk 1.8 installed on the machine…

If i run a dir of Java folder i get:

2017-03-08T19:09:53.0366026Z Task         : Command Line
2017-03-08T19:09:53.0366026Z Description  : Run a command line with arguments
2017-03-08T19:09:53.0366026Z Version      : 1.1.2
2017-03-08T19:09:53.0366026Z Author       : Microsoft Corporation
2017-03-08T19:09:53.0376023Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2017-03-08T19:09:53.0376023Z ==============================================================================
2017-03-08T19:09:53.0406023Z ##[command]dir "C:\Program Files\Java\"
2017-03-08T19:09:53.0536056Z  Volume in drive C has no label.
2017-03-08T19:09:53.0536056Z  Volume Serial Number is 78C2-210A
2017-03-08T19:09:53.0536056Z 
2017-03-08T19:09:53.0536056Z  Directory of C:\Program Files\Java
2017-03-08T19:09:53.0536056Z 
2017-03-08T19:09:53.0606019Z 12/02/2016  02:25 AM    <DIR>          .
2017-03-08T19:09:53.0606019Z 12/02/2016  02:25 AM    <DIR>          ..
2017-03-08T19:09:53.0606019Z 12/02/2016  02:25 AM    <DIR>          jdk1.6.0_45
2017-03-08T19:09:53.0606019Z 12/02/2016  02:24 AM    <DIR>          jdk1.7.0_75
2017-03-08T19:09:53.0606019Z 12/02/2016  02:23 AM    <DIR>          jdk1.8.0_102
2017-03-08T19:09:53.0606019Z 12/02/2016  02:23 AM    <DIR>          jre1.8.0_102
2017-03-08T19:09:53.0606019Z 12/02/2016  02:25 AM    <DIR>          jre6
2017-03-08T19:09:53.0606019Z 12/02/2016  02:24 AM    <DIR>          jre7
```<br>

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

@madhurig @thechrisjohnson Is the Java installed on VS2017 Hosted Image? do we have plan to fix it?

Also the “java” capability is missing in Hosted 2017 agents, it was there in the old Hosted agents. When I try to use the SonarQube tasks from the Marketplace they are failing on Hosted 2017 agents because Java is missing. Don’t know if fixing the JDK path is sufficient. Perhaps also the “java” capability needs to be added.

Can somebody confirm that this is a bug and needs to be fixed? We are currently blocked a bit because we cannot run our static code analysis in CI. Don’t want to setup private agents for that now.