-
Notifications
You must be signed in to change notification settings - Fork 193
Compiling code for older java releases
Julien HENRY edited this page Dec 7, 2022
·
3 revisions
Tycho requires Java 17 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-version
from 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-plugin
with at least the following settings (see Issue #51):
<useJDK>BREE</useJDK>
<deriveReleaseCompilerArgumentFromTargetLevel>false</deriveReleaseCompilerArgumentFromTargetLevel>