Skip to content

Compiling code for older java releases

Julien HENRY edited this page Dec 7, 2022 · 3 revisions

Compiling code for older java releases

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:

  1. 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
  2. If you still need to compile legacy code, it might be easier to simply use an older tycho-version from maven central.
  3. 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.

Example using JDK8

Tycho contains one example of an integration test that is using a JDK8 you can find it here, the important parts are:

  1. make sure you have a toolchain.xml setup to point to a true Java 8 JDK, see an example here.
  2. Make sure your bundle contains a Bundle-RequiredExecutionEnvironment: JavaSE-1.8
  3. configure the tycho-compiler-plugin with at least the following settings (see Issue #51):
<useJDK>BREE</useJDK>
<deriveReleaseCompilerArgumentFromTargetLevel>false</deriveReleaseCompilerArgumentFromTargetLevel>