2012-09-25 11:05:33 UTC
One of our plugins cannot be compiled against java 1.6 and has to be
compiled with the javac of jdk 1.5. In short, one of the jdk classes has
changed the signature of one of its methods' generics between the two
versions (see version 1.5  and version 1.6 ). AFAIK, the
incompatibility is only at source level and the compiled classes should
work with both the 1.5 and 1.6 runtimes. The problem, however, is "how"
can I force tycho to use the jdk 1.5 compiler when run from the Eclipse
I read some documentation, most notably
that describes some potentially interesting options. "source" and
"target" are not enough in my case. Telling javac that my sources are in
1.5 is not enough. "fork" seems out of the question when using
tycho-compiler-plugin from version 0.14.1. My builds fail in
"compileOutOfProcess is not supported" which rules out all options that
require forking (compilerVersion, executable, ... and maybe others).
The "useJDK" option was promising... but for the life of me I could not
understand how to provide the accurate "toolchains.xml" to my builds.
Should it be located in the "<home>/.m2" of the hudsonBuild user? A way
seems to exist since I found this option used in one of the eclipse
... and the line just above the use of this option :
|TODO provide CBI-specific wiki that explains how to setup BREE libraries and toolchain.xml|
Yup, the wiki would have helped :).
The only remaining option I could find was to use the workaround
outlined by Bernd on the forum :
But that seems like a very fragile work around. Not to mention that now,
my tests fail because of the tycho-surefire-plugin
If anyone here has any experience with tying tycho/hudson builds to a
specific jdk, any workaround as to how we can provide a toolchains.xml
for our build, or simply some input as to whether this "toolchains.xml"
should be provided for all jobs that would like to use it (it seems to
me like using the BREE of our plugins should be the "default" way of
building our plugins instead of using the jdk 6...), I'd really
appreciate the help :).