Jenkins needs to be installed with the latest version of java...so always check for the version whenever you get this error.for now its java 17..command fo which isyum install java-17-openjdk -y