Using Java 17 or Java 11

October 8, 2024

Jahia 8 modules can be compiled to Java 17 (from Jahia 8.2.0) or Java 11. 

First, specify the desired compilation target by adding to the properties in your pom.xml:

<properties>
  <maven.compiler.release>11</maven.compiler.release>
</properties>

Then, upgrade the maven-jahia-plugin to use the latest version (6.10 at the time of writing):

<properties>
  <jahia.plugin.version>6.10</jahia.plugin.version>
</properties> 

About Jahia 8.1.x

There are a few specificities when working with older Jahia releases, such as Jahia 8.1.x:

  • Your module cannot be compiled with Java 17
  • If you are using Spring in your module (nor OSGI blueprint), you must use JDK 8 for compilation whereas, even if compilation succeed, your module will not deploy on Jahia.

When migrating modules codebases from Jahia 8.1, the upgrade guide to Jahia 8.2.0 contains instructions about elements that should be taken in consideration for ensuring compatiblity with Jahia 8.2 (and above).