ubuntu18.04 java path due to reasons failed to start jenkins

My cloud server ubuntu18.04 the originally installed Jenkins , today completed the installation tomcat after the original openjdk uninstalled, installed jdk8u192, this time a browser to access 8080 is the port show the tomcat page of the installation was successful, right ah, I originally jenkins go of it, should be a tomcat occupied 8080 port, this time to modify the port .

vi /etc/default/jenkins

The HTTP_POrt = 8080 instead 8888

 

Then edit jenkins startup files

we /etc/init.d/jenkins

The inside of the port also changed

 

Then restart
systemctl restart jenkins.service
view the status
systemctl status jenkins.service
discovery failed failed to start


Online Scrapped meal, did not get the last to see the error message, or with the relevant java path, which referred to the type - p java, saying this will return the actual path of java, I enter the command line type - p java, return / usr / local / jdk1.8.0_192 / bin / java. This is my installation path of java.

And then return to the startup file vi /etc/init.d/jenkins, find the line JAVA = `type -p java`, I direct this comment line, and then add a line JAVA = /usr/local/jdk1.8.0_192/bin / java, save and exit.


Restart systemctl restart jenkins.service
view the status systemctl status jenkins.service
success.

 

 Then enter the 8888 port the browser to see an old man!

 

Guess you like

Origin www.cnblogs.com/wangyi0419/p/11912535.html