0

I installed the latest java sdk (included jre) version 9.0.1 on my buildserver and restarted the agents. The agent does not seem to detect Java, the java-capabilities are missing and builds won't run because the java-capability is not set on the agent.

Is there anything i have to do to get java recognized ? the last java 8.* version was propery recognized

D.J.
  • 3,644
  • 2
  • 15
  • 22

3 Answers3

3

Based on [agent folder]\bin\Add-JavaCapabilities.ps1, there are JDK 6,7,8, no JDK 9, so it can’t recognize JDK 9. I submit a user voice here: VSTS build agent capabilities for JAVA 9, you can vote it.

You can try to add capability manually:

  1. Go to agent pool admin page (https://XXX.visualstudio.com/_admin/_AgentPool)
  2. Select the pool and agent
  3. Click Add capability
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
0

Edit: The default jvm is 11. You can use the level compatibility if your project works as well.

The default version is 1.8. You can select the version: Maven build > Advanced > JDK Version

enter image description here

dtelaroli
  • 1,227
  • 1
  • 13
  • 20
  • That is correct but requires that this java version is installed on the buildserver. There is now also a 'Java tool installer' to install/ensure the desired java version is installed/cached so there is no need to care about the capabilities-issues anymore anyway... The correct approach is now to have the java-tool-installer before the maven task or whatever you are using that requires java – D.J. Nov 08 '18 at 17:22
  • I have used VSTS self-hosted Ubuntu 16 and it has this with zero additional installation, maybe because I'm using just JRE, I will test it – dtelaroli Nov 09 '18 at 16:08
  • the hosted ubuntu image has the jdks 7 through 11 installed (according to their documentation), at the time of me writing this issue the situation with the hosted agents wasn't as good as it is now – D.J. Nov 09 '18 at 16:59
  • I got it and changed my answer. – dtelaroli Jan 02 '19 at 18:24
0

After restarting my agent it worked. The new capabilities start reflecting in system capabilities

Divyanshu mehta
  • 319
  • 4
  • 8