We’re coding a Java6 project under Eclipse Indigo and we currently have some compilations differences between our dev environment under Eclipse and our integration one with Jenkins.
- Our Eclipse are 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’re getting some compilation errors only on Jenkins, like:
both define … but with unrelated return typeswhen an interface inherits from two interfaces which declare the same method (with different but compliant types)no unique maximal instance exists for type variable B with upper bounds I,…for some methods that return a raw typeBinstead of more specificB<C>.
The question here is not to solve this problems; with a few changes in our source code we succeeded in making Jenkins compiled.
The question is: why does Jenkins compile in an other way than our Eclipse? Is there some magical parameters given to the compiler or the JVM that could make such a big difference?
Eclipse uses its own compiler. In a very few cases there are little differences between the Eclipse Compiler and the OpenJDK one. For more general information see also:
http://www.eclipse.org/jdt/core/
How does Eclipse compile classes with only a JRE?
Edit:
The compilation error with the interfaces might be related to this JDK bug: https://bugs.java.com/bugdatabase/view_bug?bug_id=6908259