【问题标题】:TeamCity server cannot find java (ubuntu)TeamCity 服务器找不到 java (ubuntu)
【发布时间】:2019-02-16 15:38:43
【问题描述】:

Ubuntu 18.04

sudo ./teamcity-server.sh 运行

Java executable of version 1.8 is not found:
- Java executable is not found under the specified directories: '', '/home/alex/TeamCity/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

Please make sure either JAVA_HOME or JRE_HOME environment variable is defined and is pointing to the root directory of the valid Java (JRE) installation

Environment variable FJ_DEBUG can be set to enable debug output

Java not found. Cannot start TeamCity server. Please ensure JDK or JRE is installed and JAVA_HOME environment variable points to it.

java-版本

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
alex@teamcity-server:~/TeamCity/bin$

$JAVA_HOME (试过 default-java, /bin)

-bash: /usr/lib/jvm/java-11-openjdk-amd64: Is a directory

$JRE_HOME (试过 default-java, /bin)

-bash: /usr/lib/jvm/java-11-openjdk-amd64: Is a directory

回显 $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/bin:/usr/bin:/sbin:/usr/games:/usr/local/games:/usr/lib/jvm/java-11-openjdk-amd64/bin

readlink -f $(哪个java)

/usr/lib/jvm/java-11-openjdk-amd64/bin/java

试过了

ln -s /usr/lib/jvm/java-11-openjdk-amd64/bin /home/alex/TeamCity/jre

它是否需要特定的 java 版本并且不适用于最新版本?

我是否错误地设置了变量?

【问题讨论】:

    标签: java ubuntu teamcity


    【解决方案1】:

    ,TeamCity 期待 Java 1.8

    找不到 1.8 版的 Java 可执行文件。

    但是你用 Java 10 喂它

    openjdk 版本“10.0.2”

    我认为的答案

    它是否需要特定的 java 版本并且不适用于最新版本?

    是“是”,它可能只需要 Java 1.8。

    【讨论】:

      【解决方案2】:

      您在 sudo 下运行服务器。也为 root 设置 $JAVA_HOME - 我猜,它只为您的用户设置。

      【讨论】:

      • 不推荐以 root 身份运行 TeamCity(适用于大多数其他软件)。
      猜你喜欢
      • 1970-01-01
      • 2017-12-21
      • 2015-10-07
      • 2018-01-17
      • 1970-01-01
      • 2015-07-15
      • 2015-12-03
      • 2013-09-23
      • 2023-03-04
      相关资源
      最近更新 更多