...
Instructions on how to run the Unified Agent from the Azure DevOps Server can be found at Microsoft Azure DevOps Services (UA) Integration.
...
Download and install Java JRE/JDK on the TFS Agent. See Unified Agent Prerequisites for supported Java versions.
Set your JAVA_HOME system variable to the relevant Java version on the TFS Agent (see versions in the previous step).Ensure you have Team Foundation Server 2018 Update 2 or a later version.
Unified Agent Configuration
...