Can I use JDK 11 for compiling Liferay DXP Projects?
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
legacy-article
learn-legacy-article-disclaimer-text
Issue
- The Compatibility Matrix for versions 7.0 until 7.3 under the heading JDK mentions Java 11 but says:
"JDK Certification is for runtime only. JDK 8 is required to build or compile Liferay DXP Projects"
- For 7.4 the message is:
"JDK compatibility is for runtime and project compile time. DXP source compile is compatible with JDK 8 only."
- What does this mean regarding compilation with Java 11?
Environment
- Liferay DXP 7.0, 7.1, 7.2, 7.3, 7.4.
Resolution
- For Liferay DXP 7.3 and below, compatibility with JDK11 depends on the project and customizations that you are creating. Many times you will not have any issues, but there are some third party jars in DXP that have not been updated to work with JDK11. You might see LPS-99777 as an example.
- While it is possible to compile your projects in DXP 7.3 and below using JDK11, one main reason why we have the warning note on the Compatibility Matrix is that JDK8 is the version we tested and fully support.
- For DXP 7.3 and below, please approach JDK11 with the same precaution you would apply to anything which is not listed on the matrix. You might find that JDK11 works for you, and in that case, you are welcome to use it. However, Liferay can not guarantee that it will work in 100% of the cases and if you experience any issues with JDK11 compilation, our support options will be limited and we would suggest that to use JDK8 compilation instead.
- For Liferay DXP 7.4 the JDK versions mentioned are compatible not only for runtime but for project compilation. Note that DXP source compilation is still only compatible with JDK8 as for lower versions.
did-this-article-resolve-your-issue