Knowledge Base
Published Jun. 30, 2025

Liferay IDE: Resolving 'Unable to make field private' errors with JDK 21

Written By

Stanley Huang

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.

Issue

  • I'm encountering java.lang.reflect.InaccessibleObjectException: Unable to make field private ... accessible errors when starting Liferay from the Liferay IDE plugin within the Eclipse IDE with JDK 21.

Environment

  • 2024.Q2.12

Resolution

The error occurs because the Liferay IDE's server startup does not include the necessary JVM arguments required for JDK 21.

To fix this manually,

  1. Open the Server Configuration in Liferay IDE.
  2. Select "Open launch configuration".
  3. Navigate to "Arguments" -> "VM arguments".
  4. Add --add-opens=java.base/sun.util.calendar=ALL-UNNAMED.
  5. Save the configuration.

Additional Information

  • This issue is fixed in version 2025.Q2.
Did this article resolve your issue ?

Knowledge Base