Home:ALL Converter>Jenkins fails to start on centOS7

Jenkins fails to start on centOS7

Ask Time:2017-02-21T15:09:37         Author:User

Json Formatter

I am using jenkins on my centOS7/linux server. When I start jenkins and checked the status it showed me like this.

>jenkins.service - Jenkins Service  
>   Loaded: loaded (/etc/systemd/system/jenkins.service; enabled; vendor preset:  >  disabled)  
>   Active: failed (Result: exit-code) since Mon 2017-02-20 22:52:19 PST; 22s   > ago  
>  Process: 40251 ExecStart=/usr/bin/java -jar /usr/local/bin/jenkins.war    
>(code=exited, status=1/FAILURE)  
> Main PID: 40251 (code=exited, status=1/FAILURE)  
>Feb 20 22:52:19 CentOS7 systemd[1]: Started Jenkins Service.  
>Feb 20 22:52:19 CentOS7 systemd[1]: Starting Jenkins Service...  
>Feb 20 22:52:19 CentOS7 java[40251]: Error: Unable to access jarfile >/usr/l...ar  
>Feb 20 22:52:19 CentOS7 systemd[1]: jenkins.service: main process exited, >c...RE  
>Feb 20 22:52:19 CentOS7 systemd[1]: Unit jenkins.service entered failed state.  
>Feb 20 22:52:19 CentOS7 systemd[1]: jenkins.service failed.  
>Hint: Some lines were ellipsized, use -l to show in full.  

So I uninstalled the jenkins sudo yum remove jenkins by this command, and installed it again sudo yum install jenkins.
Now again facing the same issue.

Can anyone tell me what to do.

Thanks!!

Author:User,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/42360823/jenkins-fails-to-start-on-centos7
McGrady :

Before you can install Jenkins, you need to setup a Java virtual machine on your system\n\nyum install java-1.8.0-openjdk.x86_64\n\n\nAnd set two environment variables: JAVA_HOME and JRE_HOME.\n\necho 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' | sudo tee -a /etc/profile\necho 'export JRE_HOME=/usr/lib/jvm/jre' | sudo tee -a /etc/profile\nsource /etc/profile\n\n\nThen install jenkins and allow inbound traffic on port 8080.\n\nYou can see more details from how to install jenkins on Centos 7.\n\nHope this helps.",
2017-02-21T07:47:05
yy