-
Notifications
You must be signed in to change notification settings - Fork 202
Compiling code for older java releases
Matthias Mailänder edited this page Nov 30, 2022
·
4 revisions
Tycho requires Java 11 to run the build, but you can still use older jdks to build your code using toolchains. Just keep in mind the following:
- Compiling for old releases is made available on a best effort basis and support for non-modular JVM (JDK < 9) will likely be dropped in Tycho 3.x line
- If you still need to compile legacy code, it might be easier to simply use an older
tycho-versionfrom maven central. - If you find a bug the best is to provide a good small reproducer and be prepared that if you don't provide a fix or pay someone to do so it is very unlikely it will ever get fixed.
Tycho contains one example of an integration test that is using a JDK8 you can find it here, the important parts are:
- make sure you have a toolchain.xml setup to point to a true Java 8 JDK, see an example here.
- Make sure your bundle contains a
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 - configure the
tycho-compiler-pluginwith at least the following settings (see Issue #51):
<useJDK>BREE</useJDK>
<deriveReleaseCompilerArgumentFromTargetLevel>false</deriveReleaseCompilerArgumentFromTargetLevel>