7

I have Jenkins running on my Ubuntu 14.04, and i am trying to do upgrade for jenkins using normal apt-get install jenkins, but when i try to do it, i keep getting the error:

Setting up jenkins (2.73) ...
Found an incorrect Java version
Java version found:
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)

Aborting
invoke-rc.d: initscript jenkins, action "start" failed.
dpkg: error processing package jenkins (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)

Nothing shown in the jenkins logs, even when restarting jenkins i get the same jave wrong version error,

Any help please?

MohammedSimba
  • 184
  • 1
  • 1
  • 9

3 Answers3

9

You're using Java 7, but Jenkins needs Java 8 - see: https://jenkins.io/blog/2017/04/10/jenkins-has-upgraded-to-java-8

Ladadadada
  • 508
  • 3
  • 15
racraman
  • 4,988
  • 1
  • 16
  • 16
4

You need JDK 8 to run jenkins: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

Ognjen Mišić
  • 1,219
  • 17
  • 37
1

Update your java version by using these commands,

sudo -E add-apt-repository ppa:openjdk-r/ppa 

sudo apt-get update

sudo apt-get install openjdk-8-jdk

and follow this command to change your default selection mode of java version.

sudo update-alternatives --config java

It should be set to java 8 values.