How to get java path in CentOS?

前端 未结 4 579
旧巷少年郎
旧巷少年郎 2020-12-05 20:36

I need to configure my Jenkins Server and I need to add Java path to Jenkins configuration.

yum install java-1.8.0-openjdk

Ho

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 20:57

    They usually reside in /usr/lib/jvm. You can list them via ll /usr/lib/jvm. The value you need to enter in the field JAVA_HOME in jenkins is /usr/lib/jvm/java-1.8.0-openjdk.

    Update

    when I look at '/usr/lib/jvm' I get ...

    What you see there is a list of symbolic links pointing to a similar target located in /etc/alternatives. In the end they all point to the same target. The difference is only the name which allows you to choose how explicit your choice if the target version shall be.

    (Because java-1.8.0-openjdk is missing: Maybe you also need to install the package java-1.8.0-openjdk-devel.)

提交回复
热议问题