Jenkins not able to access java : localhost jenkins[807]: Starting Jenkins bash: /usr/bin/java: Permission denied
<p>I have installed and configured jenkins on the centos 7.I have added valid <strong>java path</strong> i.e "/usr/bin/java" in the file <strong>/etc/init.d/jenkins</strong>.</p>

<p>Below are the java path detils:</p>

<pre><code>lrwxrwxrwx. 1 root root 22 Dec 24  2015 java -&gt; /etc/alternatives/java
</code></pre>

<p>Now, on running "service jenkins start" command from <strong>root user</strong>, I am getting below error.</p>

<pre><code>● jenkins.service - LSB: Jenkins Continuous Integration Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins)
   Active: failed (Result: exit-code) since Wed 2016-07-13 18:25:51 IST; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 807 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)

Jul 13 18:25:51 localhost systemd[1]: Starting LSB: Jenkins Continuous Integration Server...
Jul 13 18:25:51 localhost runuser[812]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Jul 13 18:25:51 localhost jenkins[807]: Starting Jenkins bash: /usr/bin/java: Permission denied
Jul 13 18:25:51 localhost runuser[812]: pam_unix(runuser:session): session closed for user jenkins
Jul 13 18:25:51 localhost jenkins[807]: [FAILED]
Jul 13 18:25:51 localhost systemd[1]: jenkins.service: control process exited, code=exited status=1
Jul 13 18:25:51 localhost systemd[1]: Failed to start LSB: Jenkins Continuous Integration Server.
Jul 13 18:25:51 localhost systemd[1]: Unit jenkins.service entered failed state.
Jul 13 18:25:51 localhost systemd[1]: jenkins.service failed.
</code></pre>

<p>I am not able to figure out why it's giving me permission denied even though every user having access to the java path.</p>

<p><strong>also on running "journalctl -xe" command it shows below log:</strong></p>

<pre><code>Jul 13 18:45:33 localhost systemd[1]: Unit jenkins.service entered failed state.
Jul 13 18:45:33 localhost systemd[1]: jenkins.service failed.
Jul 13 18:45:33 localhost polkitd[20151]: Unregistered Authentication Agent for unix-process:27889:3161602 (system bus name :1.303, object path /org/freedesktop/PolicyKit1/AuthenticationAgen
</code></pre>

<p>Is it like that the Jenkins service does't having permission to access the java path? if not why it's giving that error?</p>