teamcity agents are standalone JVMs. In the agent configuration, you can determine which version of java is used by default.
If you do not specify any version of java for your assembly goals (steps), the standard java version of the agent will be used.
To do this, install the latest version of java on the host on which the agent is running. Then change the default JRE for the agent that should run java 8. After that, you need to create a pool for agents that can run on java8, and make sure that your target is running on this agent. You can even map specific agents to a target in the Agent Requirements section .
source share