Compilation errors in Jenkins but not in Eclipse

We are coding a Java6 project under Eclipse Indigo, and currently we have some compilation differences between our dev environment in Eclipse and our integration with Jenkins.

  • Our Eclipse is under Windows 7 with JDK 1.6.0_30 .
  • Jenkins is under Linux with JDK 1.6.0_31 (also tested with version 1.6.0_24).

The fact is that we get some compilation errors only on Jenkins, for example:

  • both define … but with unrelated return types , when an interface inherits from two interfaces that declare the same method (with different but compatible types)
  • no unique maximal instance exists for type variable B with upper bounds I,… for some methods that return a raw type B instead of the more specific B<C> .

The issue here is not to solve these problems; with a few changes in our source code, we were able to compile Jenkins.

Question: Why does Jenkins compile differently than our Eclipse? Are there any magic parameters provided to the compiler or JVM that can make such a big difference?

+4
source share
1 answer

Eclipse uses its own compiler. In very few cases, the differences between the Eclipse compiler and OpenJDK are small. See also:

http://www.eclipse.org/jdt/core/

How does Eclipse compile classes with JRE only?

Edit:

A compilation error with interfaces may be related to this JDK error: http://bugs.sun.com/view_bug.do?bug_id=6908259

+5
source

All Articles