0

I've installed Jenkins on a Debian system using the instructions here:

https://www.jenkins.io/doc/book/installing/linux/#debianubuntu

It works fine, but gives a warning in the log on every startup:

"Java is not in the PATH nor configured with the javaPath setting, Jenkins will try to guess where is Java,this guess will be remove in the future"

What's the correct way to fix this warning?

I'm assuming adding something to /etc/default/jenkins, but I'm not 100% sure exactly what.

(tagging Ubuntu too, as the issue/fix should be the same there, as the Jenkins packages are common)

Michael Firth
  • 131
  • 1
  • 8
  • The is a message from inside `/etc/default/jenkins`. It's a shell script. You can examine it and see. It expects a env JAVA_HOME, or goes searching /usr/bin/java, /etc/alternatives/java, etc. You can edit and set a propoerty there or in a jenkins.conf and.load it. – Ian W May 19 '21 at 11:11

1 Answers1

0

You need to create JAVA_HOME environment variable or add java path to PATH variable.
Assuming you have openjdk-8 installed you need to issue the commands:

to create JAVA_HOME variable

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

and to add it to PATH

export PATH=$PATH:$JAVA_HOME/bin