My default java is located in the following location-
admin@pc1:~$ readlink -f $(which java)
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
So,I set the above directory (ie./usr/lib/jvm/java-11-openjdk-amd64/bin/java) as the JAVA_HOME in the Jenkins-Global Tool Configuration but, it's showing the following message-
/usr/lib/jvm/java-11-openjdk-amd64/bin/java is not a directory on the Jenkins master (but perhaps it exists on some agents)
So I removed the /bin/java -portion and pasted the following /usr/lib/jvm/java-11-openjdk-amd64but, it still showing the same message.
$JAVA_HOME was not previously set to my pc,So I set the $JAVA_HOME to /usr/lib/jvm/java-11-openjdk-amd64 through terminal;then I again tried to set the JAVA_HOME in Jenkins, but, it's still showing the same message.
What is the reason?