[英]Jenkins Java_Home path doesnt look like a JDK directory
I have configured Jenkins on AWS RHEL-8.6 EC2 instance.我已经在 AWS RHEL-8.6 EC2 实例上配置了 Jenkins。 Also setup the java path variable in bash profile.
还要在 bash 配置文件中设置 java 路径变量。 I am getting below error while configuring JDK path in Jenkins.
在 Jenkins 中配置 JDK 路径时出现以下错误。
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64 doesn’t look like a JDK directory
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64
PATH=$PATH:$JAVA_HOME:$HOME/bin
[root@ip-172-31-0-152 ~]# find /usr/lib/jvm/java-1.8* |head -n 20
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64
I think there is maybe a mistake in your initial PATH.我认为您的初始 PATH 可能有错误。 Login to your account and open.bash_profile file in your home.
登录您的帐户并在家中打开.bash_profile 文件。 You can use vi or nano to edit it...
您可以使用 vi 或 nano 来编辑它...
nano ~/.bash_profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64
export PATH=$JAVA_HOME/bin:$PATH
Don't forget to update your current user sesssion from a terminal to activate the new path settings: source ~/.bash_profile
不要忘记从终端更新您当前的用户会话以激活新的路径设置:
source ~/.bash_profile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.