Legacy Knowledge Base
Published Sep. 10, 2025

"Lambda expressions are allowed only at source level 1.8 or above" warning occurs in the logs

Written By

Kartik Singh

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The following warning occurs in the logs while configuring the WebSphere application server with Liferay.
WARN  [WebContainer : 4][code_jsp:162] {code="500", msg="JSPG0049E: /html/common/themes/top_head.jsp failed to compile : __JSPG0225E: An error occurred at line: 21 in the statically included file: /html/common/themes/top_portlet_resources_css.jspf_JSPG0093E: Generated servlet error from file: /html/common/themes/top_head.jsp __/was/IBM/WebSphere/AppServer/profiles/portal1/temp/UAT-APP2-ITFO-portal1/portal1/liferay-dxp-7_3_10_1-sp1-202103111649_war/liferay-dxp-7.3.10.1-sp1-202103111649.war/html/common/themes/_top_5F_head.java : 825 : Lambda expressions are allowed only at source level 1.8 or above__JSPG0225E: An error occurred at line: 24 in the statically included file: /html/common/themes/top_portlet_resources_js.jspf_JSPG0093E: Generated servlet error from file: /html/common/themes/top_head.jsp __/was/IBM/WebSphere/AppServer/profiles/portal1/temp/UAT-APP2-ITFO-portal1/portal1/liferay-dxp-7_3_10_1-sp1-202103111649_war/liferay-dxp-7.3.10.1-sp1-202103111649.war/html/common/themes/_top_5F_head.java : 1738 : Lambda expressions are allowed only at source level 1.8 or above_", uri=/html/common/themes/portal.jsp} [Sanitized] error.

Environment

  • Liferay DXP 2024.Q1 and below version

Resolution

  • The above warnings indicate that Liferay is attempting to compile JSP files containing lambda expressions. However, the Java compiler being used does not support them because the source level is set below Java 1.8.
  • IBM documentation, stating that the error message "Lambda expressions are allowed only at source level 1.8 or above" occurs because the jdkSourceLevel does not allow the value 18. As a result, the 18 source-level option cannot be passed to the compiler in fix pack 8.5.5.11.
  • In WebSphere 9.0.5.20, where the default source level is 17 (as per WebSphere 9 documentation), this means it enables JDK 7.0 features by default. To use JDK 8.0 features, set the value to 18 in the ibm-web-ext.xmi file and save it.
  • Kindly check ibm-web-ext.xmi file and update the source level to 18 to see if the issue persists.

    • For further insights, here is Liferay’s official documentation on Setting the JDK Version for Compiling JSPs:

      DXP requires that its JSPs are compiled to the Java 8 bytecode format. To ensure that WebSphere does this, shut down WebSphere after you’ve deployed the DXP .war file. Navigate to the WEB_INF folder and add <jsp-attribute name="jdkSourceLevel" value="18" /> to the ibm-web-ext.xml or in most cases the ibm-web-ext.xmi file.

 

 

Did this article resolve your issue ?

Legacy Knowledge Base