For TeamCity agent Java requirements, check Setting up and Running Additional Build Agents.
TeamCity selects the Java to run the server process as follows:
- If your TeamCity installation has a bundled JRE (there is the
<TeamCity Home>\jredirectory), it will always be used to run the TeamCity server process.
- If there is no
<TeamCity Home>\jredirectory present, set
JAVA_HOMEenvironment variables pointing to the installation directories of JRE or JVM (Java SDK) respectively. JRE will be used if both are present.
The necessary steps to update the Java installation depend on the distribution used.