Another "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" when executing runAll.sh
Answered
Hello:
Completely new to TeamCity. I tried to run it for the first time after reading TeamCity-readme.txt. Before posting, I did a search of the community and found these URLs -- no help:
I ran /opt/tc/latest/bin/runAll.sh start and got these errors:
Spawning TeamCity restarter in separate process
TeamCity restarter running with PID 30132
Starting TeamCity build agent...
Java executable of version 1.5 is not found:
- Java executable is not found under the specified directories: '', '', '/opt/tc/latest/buildAgent/bin/../jre', '/opt/tc/latest/buildAgent/bin/../../jre'
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Java executable is not found in the default locations
- Java executable is not found in the directories listed in the PATH environment variable
Here's some info about my system:
cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
echo $JAVA_HOME
/opt/java/latest
java --version
openjdk 13.0.2 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
I'm completely confused. As the above illustrates, I have JAVA_HOME set and can run the java binary from anywhere (tested by spitting out the version).
Any assistance in helping me getting this working is greatly appreciated.
Thanks!
Please sign in to leave a comment.
Sorry for the inconvenience. The error message can be a bit misleading indeed, but the issue here is that Java 13 is so new that is still not recognised by the tooling we use to detect java installations. Because newer versions tend to introduce breaking changes with software coded for older ones, this issue happens often every time a new major java release comes out as it is not trivial to ensure forward compatibility. Furthermore, the error message displays trying to find java 1.5 when we do not support it either.
In your case, installing any java version between 8 and 11 and making them the default should do the trick, as those are the ones we do support. I've created a request to improve our error reporting in this scenario: https://youtrack.jetbrains.com/issue/TW-64372, please consider voting for it.
Thanks for the reply.
Java 11 was released in September 2018. There hasn't been any updates for TeamCity since then?
I ask not to be a jerk but I'm trying to find a balance between security and compatibility. Is there an anticipated release date for Java 12 or 13 compatibility?
Thanks!
Hi,
First and foremost, I want to make clear that Java 8 and 11 are still getting security updates and are planned to be getting them for the foreseeable future. Java 8 and 11 are LTS while 9, 10, 12 and 13 are not, so if security and compatibility are your concerns, Java 8 and 11 should be preferred over 12 or 13.
With this in mind, we don't really have a roadmap to upgrade to them, as their roadmap is actually shorter than expected support for versions 8 and 11. We will still work on updating our codebase for future LTS releases and try to take advantage of more modern features when possible. We are discussing ways to tag our issues in the tracker with regards to the newer versions, but currently we have no way of tracking actual issues besides explicitly searching for them.
If you have any specific concern, please feel free to share it.