Updating Java Version in TeamCity: A Necessary Step

Abstract: Resolve TeamCity deprecation warnings by updating the JVM version in the .vmoptions file without changing system-wide Java settings.

Created: 2026-10-20 by
To update the Java version in TeamCity and resolve deprecated warnings, you must modify the JVM startup options rather than changing the system-wide default. Locate the specific .vmoptions file for your installation, such as teamcity-server.vmoptions, and ensure it points to a supported JDK path. This approach guarantees that the TeamCity service uses the correct runtime without affecting other applications on the host machine.

Why Update TeamCity Java?

TeamCity relies heavily on Java for its core functionality, including build agents, the server interface, and database interactions. Over time, older Java versions reach end-of-life status, leading to security vulnerabilities and performance degradation. More commonly, recent updates to TeamCity introduce new features or dependencies that require a minimum Java version, typically Java 11 or higher depending on the specific release.

When running an outdated Java version, administrators often encounter deprecation warnings in the logs. These warnings indicate that certain APIs used by TeamCity are no longer recommended and may be removed in future releases. Ignoring these warnings can lead to unexpected failures during builds or even prevent the TeamCity server from starting after a major upgrade. Updating the JVM ensures compatibility with the latest patches and maintains system stability.

Locating the Configuration Files

The most critical step is identifying the correct configuration files for your operating system. Unlike some services that use generic system-wide configurations, TeamCity isolates its JVM settings within its own installation directory. You should never edit global system environment variables like JAVA_HOME if you want TeamCity to behave independently of other software.

For Linux distributions, including Ubuntu, the relevant files are typically located in the conf directory of the TeamCity installation path. Common paths include /opt/teamcity/conf/ or /usr/local/teamcity/conf/. Inside this folder, look for files ending in .vmoptions, specifically teamcity-server.vmoptions for the main server process and teamcity-agent.vmoptions for build agents. Windows installations follow a similar structure, usually found under C:\Program Files\JetBrains\TeamCity\conf\.

If you cannot find these files, check the bin directory where the start scripts reside. The scripts often reference the conf directory explicitly. Ensure you have administrative privileges before attempting to modify these files, as they are protected by standard user permissions.

Distinguishing Between Server and Agent Configs

It is vital to distinguish between the server and agent configurations. The teamcity-server.vmoptions file controls the memory and Java version for the web interface and database connections. The teamcity-agent.vmoptions file controls the resources available to individual build runners. If you are experiencing issues only on specific build machines, you may need to update the agent configuration separately. However, for general deprecation warnings related to the platform itself, the server configuration is the primary target.

Modifying the VM Options

Once you have located the correct .vmoptions file, open it with a text editor. You will see a list of flags that control the JVM behavior. To change the Java version, you generally do not need to add a new flag unless you are switching between different major versions installed on the same machine. Instead, verify that the -java-home parameter is correctly set.

# Example teamcity-server.vmoptions content
-Xms256m
-Xmx1024m
-java-home /usr/lib/jvm/java-11-openjdk-amd64
-Djava.util.logging.config.file=logging.properties
-Dfile.encoding=UTF-8

If the -java-home line is missing, TeamCity defaults to the first Java installation found in your system PATH. Adding this line explicitly forces TeamCity to use the specified JDK. Replace the path with the actual location of your desired Java installation. For example, on Ubuntu, this might be /usr/lib/jvm/java-17-openjdk-amd64. On Windows, it would look like C:\Program Files\Java\jdk-17.

If you are upgrading from Java 8 to Java 11 or 17, ensure that any legacy parameters are still valid. Some older GC (Garbage Collector) flags may have changed syntax. Review the official Oracle or OpenJDK documentation for the target version to confirm parameter compatibility. After making changes, save the file and close the editor.

Restarting the Service

Changes to .vmoptions files do not take effect until the TeamCity service is restarted. On Ubuntu, you can restart the service using systemd commands. Run sudo systemctl restart teamcity to apply the new configuration. On Windows, open the Services management console, locate the TeamCity service, and select Restart.

After restarting, monitor the logs closely. Navigate to the Administration section of the TeamCity web interface and check the System Report. It should now display the updated Java version. If the service fails to start, review the log files located in the logs directory of the TeamCity installation. Look for errors related to invalid arguments or missing libraries, which often indicate a typo in the -java-home path.

Maintaining Compatibility Across Agents

Updating the server Java version is only part of the equation. Your build agents must also run compatible Java versions to execute builds successfully. If your agents are running on different operating systems, you must update each agent's teamcity-agent.vmoptions file individually. Alternatively, you can configure the agents to download their own JRE automatically by enabling the "Use embedded JRE" option in the agent configuration settings. This reduces manual maintenance overhead but requires sufficient disk space on each agent machine.

Regularly checking for Java updates is essential for security. Consider setting up a cron job or scheduled task to notify you when new LTS (Long Term Support) versions are released. This proactive approach prevents the accumulation of technical debt and ensures that your CI/CD pipeline remains robust and secure.

Frequently Asked Questions

Can I change the Java version globally for all applications?

No, it is strongly advised against changing the global JAVA_HOME environment variable just for TeamCity. Doing so may break other applications that rely on a different Java version. TeamCity’s isolated .vmoptions files allow you to manage its runtime independently.

What happens if I point to a non-existent Java path?

If the -java-home parameter points to a directory that does not contain a valid JDK, the TeamCity service will fail to start. The error logs will typically show a message indicating that the Java executable could not be found or that the version is unsupported.

Do I need to update Java on every build agent manually?

Not necessarily. You can configure build agents to use an embedded JRE provided by TeamCity. Enable this option in the agent configuration to automate updates and reduce manual intervention on each build machine.

Is Java 8 still supported in recent TeamCity versions?

Most recent major releases of TeamCity have dropped support for Java 8. While older versions may still run on Java 8, upgrading to Java 11 or 17 is required for new features and security patches. Check the release notes for your specific TeamCity version to confirm minimum requirements.

How do I verify the current Java version used by TeamCity?

You can verify the active Java version by visiting the System Report page in the TeamCity administration panel. Look for the "Java Version" field, which displays the exact runtime being used by the server process.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More