Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42709

Unable to build Jenkins with Java 8 set as target version

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Jenkins 2.49, master as of 2017-03-12

      Playing with some Java 8 related improvements in Jenkins I've noticed that Jenkins cannot be built with Java 8 set as desired source/target level and it looks somehow tricky.

      [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 1048 source files to /home/foo/Code/jenkins/core/target/classes
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR :
      [INFO] -------------------------------------------------------------
      [ERROR] /home/foo/Code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
      [ERROR]   required: Iterable<? extends J#1>
        found: Iterable<Job>
        reason: inferred type does not conform to lower bound(s)
          inferred: J#2
          lower bound(s): T,Job
        where J#1,R#1,R#2,J#2,R#3,T are type-variables:
          J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
          R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
          R#2 extends Run declared in class RunList
          J#2 extends Job<J#2,R#3>
          R#3 extends Run<J#2,R#3>
          T extends J#2
      /home/foo/Code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
      [INFO] 2 errors
      [INFO] -------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] Jenkins main module ................................ SUCCESS [  2.169 s]
      [INFO] Jenkins cli ........................................ SUCCESS [  3.655 s]
      [INFO] Jenkins core ....................................... FAILURE [ 35.684 s]
      [INFO] Jenkins war ........................................ SKIPPED
      [INFO] Tests for Jenkins core ............................. SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE

       Error can be reproduced in my branch.

      As migration to Java 8 is getting closer and closer it would be good to have it solved.

            batmat Baptiste Mathus
            emszpak Marcin Zajączkowski
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: