jenkins maven build requires specific jdk 1.6 version

46 views
Skip to first unread message

dodtsair

unread,
Oct 23, 2011, 10:10:52 PM10/23/11
to Jenkins Developers
Jenkins maven build "mvn clean -Plight-test install" fails on my local
machine. I am thinking this is due to the fact that the jdk that
comes by default on my ubuntu is javac 1.6.0_22

Based on
http://stackoverflow.com/questions/2858799/generics-compiles-and-runs-in-eclipse-but-doesnt-compile-in-javac
and
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6369605

It seems jenkins is built by jdk6_24
http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/configure

Here is the error I see on my console:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
plugin:2.
3.2:compile (default-compile) on project jenkins-core: Compilation
failure: Comp
ilation failure:
[ERROR] /home/mpower/Workspace/jenkins/core/src/main/java/hudson/
DescriptorExten
sionList.java:[84,35] incompatible types; no instance(s) of type
variable(s) D e
xist so that hudson.DescriptorExtensionList<T,D> conforms to
hudson.DescriptorEx
tensionList<T,D>
[ERROR] found : <D>hudson.DescriptorExtensionList<T,D>
[ERROR] required: hudson.DescriptorExtensionList<T,D>
[ERROR] /home/mpower/Workspace/jenkins/core/src/main/java/jenkins/
model/GlobalConfiguration.java:[51,54] incompatible types; no
instance(s) of type variable(s) D exist so that
hudson.DescriptorExtensionList<jenkins.model.GlobalConfiguration,D>
conforms to hudson.ExtensionList<jenkins.model.GlobalConfiguration>
[ERROR] found :
<D>hudson.DescriptorExtensionList<jenkins.model.GlobalConfiguration,D>
[ERROR] required:
hudson.ExtensionList<jenkins.model.GlobalConfiguration>

Does this jive with what everyone knows? Is there a work around for
jdk6_22? If there is not might want to update
https://wiki.jenkins-ci.org/display/JENKINS/Building+Jenkins

Mike Power

Mark Waite

unread,
Oct 23, 2011, 11:43:50 PM10/23/11
to jenkin...@googlegroups.com
Wouldn't it be better to upgrade from JDK 1.6.22 to a more recent version so you can have the security fixes and the bug fixes that are available in the more recent JDK versions?

The last time I checked, the JDK 6 download from Oracle was at 1.6.29.  I suspect the Ubuntu servers are willing to deliver you a newer version of the JDK so you can have the latest bug fixes and security fixes.  They may not be willing to deliver 1.6.29, but I suspect they will delivery something new enough to resolve this issue for you.

Warning: I am a Debian user, not a Ubuntu user, so I can't confirm with certainty that a newer JDK is available for you.  My Debian "wheezy" (the testing distribution) is currently running JDK 1.6.26.  My Oracle Linux machine (a Red Hat derivative) is running JDK 1.6.27.

Mark Waite


From: dodtsair <mpower...@dodtsair.com>
To: Jenkins Developers <jenkin...@googlegroups.com>
Sent: Sunday, October 23, 2011 8:10 PM
Subject: jenkins maven build requires specific jdk 1.6 version

dodtsair

unread,
Oct 24, 2011, 11:16:24 PM10/24/11
to Jenkins Developers
Here is what they got so far http://us.archive.ubuntu.com/ubuntu/pool/main/o/openjdk-6/

Taking the latest ubuntu release bumps me up to 23 or I can choose
java7. Both of which do not work.

The point is moot, getting a compatible jdk is my problem not yours.

On Oct 23, 8:43 pm, Mark Waite <markwa...@yahoo.com> wrote:
> Wouldn't it be better to upgrade from JDK 1.6.22 to a more recent version so you can have the security fixes and the bug fixes that are available in the more recent JDK versions?
>
> The last time I checked, the JDK 6 download from Oracle was at 1.6.29.  I suspect the Ubuntu servers are willing to deliver you a newer version of the JDK so you can have the latest bug fixes and security fixes.  They may not be willing to deliver 1.6.29, but I suspect they will delivery something new enough to resolve this issue for you.
>
> Warning: I am a Debian user, not a Ubuntu user, so I can't confirm with certainty that a newer JDK is available for you.  My Debian "wheezy" (the testing distribution) is currently running JDK 1.6.26.  My Oracle Linux machine (a Red Hat derivative) is running JDK 1.6.27.
>
> Mark Waite
>
>
>
>
>
>
>
> >________________________________
> >From: dodtsair <mpower.li...@dodtsair.com>
> >To: Jenkins Developers <jenkin...@googlegroups.com>
> >Sent: Sunday, October 23, 2011 8:10 PM
> >Subject: jenkins maven build requires specific jdk 1.6 version
>
> >Jenkins maven build "mvn clean -Plight-test install" fails on my local
> >machine.  I am thinking this is due to the fact that the jdk that
> >comes by default on my ubuntu is javac 1.6.0_22
>
> >Based on
> >http://stackoverflow.com/questions/2858799/generics-compiles-and-runs...
> >and
> >http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6369605
>
> >It seems jenkins is built by jdk6_24
> >http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/c...

Vojtech Juranek

unread,
Oct 25, 2011, 4:43:59 AM10/25/11
to jenkin...@googlegroups.com
Hi,
I think that this is caused by compiling jenkins using OpenJDK, switching to
Sun JDK should solve the problem
Vojtech

Mykola Nikishov

unread,
Oct 25, 2011, 5:12:59 AM10/25/11
to jenkin...@googlegroups.com
On 10/25/2011 11:43 AM, Vojtech Juranek wrote:

> I think that this is caused by compiling jenkins using OpenJDK, switching to
> Sun JDK should solve the problem

Yes, Jenkins (as well as Hudson) are unable to build with OpenJDK. it
seems it make sense to use Maven Enfrocer's requireJavaVersion [1] and
requireProperty [2] (to check JVM's vendor) rules will prevent such
problem in the future.

[1] http://maven.apache.org/enforcer/enforcer-rules/requireJavaVersion.html
[2] http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html

--
Mykola

http://ua.linkedin.com/in/manandbytes
https://github.com/manandbytes/

dodtsair

unread,
Oct 29, 2011, 5:29:10 PM10/29/11
to Jenkins Developers
I would agree, save new developers the headache. I imagine
alternatives to sun's jdk are going to get more popular as time goes
on.

If some developer wants to try it out on his choice jdk he could
always modify the enforcer plugin.

dodtsair

unread,
Oct 29, 2011, 5:30:46 PM10/29/11
to Jenkins Developers
I forgot to mention, using the sun jdk quite obviously worked for me.
I encountered a separate classpath issue with the gmaven plugin.

On Oct 25, 2:12 am, Mykola Nikishov <m...@mn.com.ua> wrote:

Christoph Kutzinski

unread,
Oct 30, 2011, 7:13:47 AM10/30/11
to jenkin...@googlegroups.com
Am 25.10.2011 11:12, schrieb Mykola Nikishov:
> On 10/25/2011 11:43 AM, Vojtech Juranek wrote:
>
>> I think that this is caused by compiling jenkins using OpenJDK,
>> switching to
>> Sun JDK should solve the problem
>
> Yes, Jenkins (as well as Hudson) are unable to build with OpenJDK. it
> seems it make sense to use Maven Enfrocer's requireJavaVersion [1] and
> requireProperty [2] (to check JVM's vendor) rules will prevent such
> problem in the future.
>
> [1]
> http://maven.apache.org/enforcer/enforcer-rules/requireJavaVersion.html
> [2] http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html
>
Ideally, Jenkins would build with all major JDKs, but since we don't
have continuous checks to ensure that I agree that an enforcer check
would help to avoid headaches for new developers.

Do you know how the requireProperty rule would have to look like to only
accept Oracle/Sun JDKs but not OpenJDK?

Reply all
Reply to author
Forward
0 new messages