2

I have configured Jenkins on AWS RHEL-8.6 EC2 instance. Also setup the java path variable in bash profile. I am getting below error while configuring JDK path in Jenkins.

/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
Jesper
  • 202,709
  • 46
  • 318
  • 350
Tom
  • 57
  • 2

1 Answers1

0

I think there is maybe a mistake in your initial PATH. Login to your account and open .bash_profile file in your /home. You can use vi or nano to edit it from your terminal...

 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

Quentin Genet
  • 155
  • 2
  • 3
  • 15
  • Is your file `java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64` a `.rpm` file ? If it is, did you install it before ? Because when i m searching this file name on google, i can see rpm file... – Quentin Genet Aug 04 '22 at 13:15