Java 11 configured but not reflected in TC web interface
I have received this warning message about Java:
This TeamCity server is using a deprecated version of Java (8). Please upgrade to Java 11 as future versions of TeamCity will be incompatible with Java 8. Note: at the moment TeamCity does not support Java versions > 11
And have followed the instructions here on how to update it. I have tried changing JAVA_HOME and TEAMCITY_JRE variables in /etc/environment, /etc/profile.d/jdk.sh, the .profile and .bashrc of teamcity and root, used the update-alternatives tool to select correct Java, and have dug into the TC config files and executable logic itself. I found that in the findJava.sh script, the $FJ_JAVA_EXEC and $FJ_JAVA_VERSION show /usr/lib/jvm/jdk-11/bin/java and 11.0.13 respectively, as they should. When I restart TC and go to the interface and reset TC server, I don't see the variables in Administration -> Diagnostics -> Internal Properties as changed and the warning message is still there:
I know there have been questions about this, but I haven't found anything to help this issue. Please let me know what I can do.
Thanks!
Please sign in to leave a comment.
Where and what to set depends on how you start the service. If you are starting it through systemd, you should set it in the unit file, it won't help setting them elsewhere. This is due to how systemd manages sessions, so there's not much we can do there.
Environment=JRE_HOME=/usr/lib/jvm/java-11-openjdk
Please refer to systemd's documentation for more details on this.
If you are starting it through the console, the best suggestion would be to start the process through adding the envvar declaration directly to the command, such as:
JRE_HOME=/path/to/java/11 /opt/jetbrains/TeamCity/bin/teamcity-server.sh start
As a reminder, the JRE_HOME should point to the base folder of the installation and not to the java executable
This said, you seem to have a pretty old release of java 8 installed. If you are not using it for anything else in the server, it might be simpler to simply uninstall it entirely. Of course, the tips above should work but just removing java 8, unless you have manually modified the startup scripts should be just easier
Hi Denis, thanks for getting back.
I went in and changed /etc/init.d/teamcity line from
to
as suggested. When I do this and reboot, the web interface shows me this error
Let me know if there is anything else I can try. Thanks
Here is the last bit from the teamcity-server.log
Hi Denis,
Any more insight you can give me? I attempted some things from other posts here, creating the <Teamcity Home>/jre directory and moving the installed jdk-11 there. I'm still seeing an issue where the server won't start. Please let me know, thanks!
Sorry for the delay. If the issue was the JRE you would not be seeing any issue in the logs as the logs are written by java. You can check the first few lines after restarting the server to see which version of java is being run right now.
It seems like the database does not work properly. As the error states, you should:
-check that the database is actually running. TeamCity won't run without a database
-make sure that the jdbc connector works with both java 11 and your database version. You can find more about the connector here: https://www.jetbrains.com/help/teamcity/set-up-external-database.html#On+TeamCity+Server+Side+(with+MySQL) . Usually just downloading the latest available and putting it in place is likely to work
-check that the data in the database.properties is correct. I assume it is correct since you probably didn't change it with the java switch, but just in case.
Here are the versions of the JDBC and MySQL.
It looks like they are compatible
And going back into the logs when I get the error message, it looks like Java 11 is running, and I'm not seeing anything different from a boot where the server runs. Here is the log:
How do I check if the database is actually running?
Looks like updating the jdbc connector worked! I see in your documentation from the link it has to be the same version. Thanks for all your help!